0
\$\begingroup\$

I'm using LibGDX and Box2D and I want to have multiple falling platforms in a row which will fall sequentially as the player runs on them, like in the picture below. (the shapes are parsed from Tiled)

enter image description here

When I use simple rectangles I have the problem of ghost vertices.

Chain shapes eliminate them but according to the documentation they are meant for static bodies. I actually gave them a go and indeed when I set a velocity to the Kinematic body they just disappear.

Any idea how I could tackle this? Excuse me if it's something fairly simple, I'm new to box2d.

\$\endgroup\$
  • \$\begingroup\$ Can you describe what the observable symptoms of "ghost vertices" are, that you want to solve? \$\endgroup\$ – DMGregory Jul 31 '19 at 13:49
  • \$\begingroup\$ When the player runs across the platforms but does not have high enough speed, it gets stopped between the gap. (this happens even if I place the platforms right next to each other with no gap). A workaround is to just place each platform slightly lower than the previous one. But this is just a way to bypass the problem, it's not really a solution. \$\endgroup\$ – xmac Jul 31 '19 at 16:45
  • \$\begingroup\$ Have you read previous questions about getting stuck at the borders of box colliders? ("tile stuck" makes a good search query for turning up a bunch of them) This is a common physics engine quirk you can learn more about in this GDC talk by Bennett Foddy \$\endgroup\$ – DMGregory Jul 31 '19 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.