Jump to content

A simple way to prevent falling between P2 objects


gregkarber
 Share

Recommended Posts

I have made this game Lettuce Climb that procedurally generates a mountain for you to climb as a head of lettuce.

However, I have persistently had an issue with the head of lettuce slipping 'between' two physics bodies. The bodies are generated randomly, and while I connect all the square ones to form one long rectangular P2 body, the triangular tiles are individual, separate P2 bodies.

Frequently, when the player is falling, they will slip between this triangular body and the square body next to it.

I have tried a number of solutions to fix this, including limiting the speed at which the player falls, and trying to overlap the bodies. But no matter what I do, this problem persists. There has got to be a simpler way to fix this!

If anybody could help me out, I would be greatly in debt to them. This problem has persisted for years, and I'd love a way to remedy a persistent player complaint. (Years ago, I just made it so that if you slip through, it would eventually respawn you -- that makes it not game-breaking, but still frustrating.)

Thank you very, very much!

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...