A simple way to prevent falling between P2 objects

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!


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.