Jump to content

Player can jump on box but not move them (but they still fall under gravity


Skeptron
 Share

Recommended Posts

Hi guys!

My problem is dead simple but I can't find any perfect solution for it.

I have a game, let's say Mario-like, where there's a player and some boxes. I want the boxes to act like normal arcade physics objects : they fall under gravity (they can be dropped from the sky). And I want the player to be able to jump on them. However, I do not want the player to be able to 'push' the boxes.

Also, the boxes can stack on top of others. And the ones under can be destroyed, so the others on top have to fall onto the ground. 

Any ideas?

Thanks!

Link to comment
Share on other sites

Set their maxVelocity.x to 0? Set its mass really high? Add a customSeparateX that pushes the player "out" every time and doesn't change the position of the crate at all?

This sounds like a custom process handler to me, but maybe someone else has a better answer.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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