Hi, everyone.
I'm trying to develop a tile engine using Box2D and i'm facing the following problem.
I have one body with one attached box shape. The body has a fixed rotation angle and when I try to walk over a platform which is composed by several tiles, and hence by serveral box shapes, after few seconds moving around the character hanges being impossible to redirect it again.
To change character direction I use the SetLinearVelocity function.
Is there any way to avoid this behaviour?
Thanks.
Thanks for your reply Erin.
I guess I'll have to adapt my engine code to a newest version of Box2D (I'm currently using 2.0.1) and use 'SetAsEdge' method to define my tiles shapes.
Man at work!
The problem persists.
I've ported the engine to the newest version of Box2D and i set edge polygon shapes for each tile in those sides where no tile or a tile of the same type are set.
Now my character keeps stucking between tiles, but after few minutes rather than after few seconds.
As you can see the character hanges while jumping next to the wall although there's an active gravity force.
Any idea about how to fix this?
Thanks.
PD: Remember the reason the why i set different edges for each tile is to be able to interact independently with them. All edges properties are set to zero.
You need to merge the collinear edges. You will have to create a mapping to the individual tile properties base on the parent edge shape and the contact coordinate.
Thanks again for reply, Erin.
I'll try that way.
Something more.
The problem also occurs with a single tile block (see the capture). It seems it not only a tile chain problem.
Any idea about how to fix that?
For the moment I'll try to attach circle shapes to the body corners to see if it helps to avoid the tile hangs.
Thanks.
No way.
Circle shapes didn't help, and my little megaman keeps hanging.
I'll try to find out another work around...
In that case you are hitting the back side of the bottom edge (normal pointing upwards). Is there are reason you want to use a square shape for your character? Why not a hexagon?
Well, the square shape it the wishable one.
About what you tell me, I guess i'll have to find another work around or to do without Box2D and its physics simulation capability.
Anyway, thanks for your attention.
PD: There's no way to fix this problematic behaviour from Box2D source?