Hi all,
Here's the situation I'm trying to work around: I have a player body, and many boxes spread around the world.
I want all bodies to be affected by gravity, I want all the boxes to collide with each other (i.e: to stack one on top of the other), but I do not want them to be affected by collisions with the player body. I have tried tons of different approaches, including setting their density to a very high number (and the player to a very low one), but nothing seems to work really well.
Another possible solution in this specific case would be to prevent their movement on the X axis altogether (as box-player collisions are on the horizontal plane most of the times). No matter what I try, the end result is quite jittery and feels very hacky.
This seems like something I keep getting problems with every time I work with Box2d... Is there a "right way" to handle these situations?
I'm using 2.1a btw.
Thanks! 🙂
Here's the situation I'm trying to work around: I have a player body, and many boxes spread around the world.
I want all bodies to be affected by gravity, I want all the boxes to collide with each other (i.e: to stack one on top of the other), but I do not want them to be affected by collisions with the player body. I have tried tons of different approaches, including setting their density to a very high number (and the player to a very low one), but nothing seems to work really well.
Another possible solution in this specific case would be to prevent their movement on the X axis altogether (as box-player collisions are on the horizontal plane most of the times). No matter what I try, the end result is quite jittery and feels very hacky.
This seems like something I keep getting problems with every time I work with Box2d... Is there a "right way" to handle these situations?
I'm using 2.1a btw.
Thanks! 🙂