So here is the situation: I have set up a collision detection with physics, and it works fine. However, when my character collides anywhere with the physics object, he slides down. This is happening even when I set the friction, bounce, and density, on the thing being collided to 0 each. How do I make it so that when my character collides with the object he just stops. My character is dynamic, and the object being is collided is static. Also, I have set the friction and bounce on the character to 0 as well. Any suggestions on how to make him simply stop when he collides with the object?
Thanks! [import]uid: 175550 topic_id: 32099 reply_id: 332099[/import]
Hi there,
I’m happy to try to help.
The first point I want to mention is, a fiction of 0 means the object is infinitely slippery (no friction). So in your situation, you probably want to set the friction to something greater than zero.
Second, you also probably don’t want to set the density of any of your objects to zero. That means they have no mass. I don’t know how Box2D handles that, but it’s probably best not to have that as a potential source of the problem, and instead give all your objects some density.
Third, when you say your character collides with the object and then slides down, what exactly do you mean? What direction is the character coming from? Do you have gravity enabled and going downward?
In general, if you want your character to “stick” to the object it collides to after they collide, you’ll probably name to create a weld joint between them. Otherwise, if there’s gravity, the character will fall down, since there’s nothing preventing the character from not falling under the influence of gravity.
I hope this helps.
- Andrew [import]uid: 109711 topic_id: 32099 reply_id: 127882[/import]
Hi there,
I’m happy to try to help.
The first point I want to mention is, a fiction of 0 means the object is infinitely slippery (no friction). So in your situation, you probably want to set the friction to something greater than zero.
Second, you also probably don’t want to set the density of any of your objects to zero. That means they have no mass. I don’t know how Box2D handles that, but it’s probably best not to have that as a potential source of the problem, and instead give all your objects some density.
Third, when you say your character collides with the object and then slides down, what exactly do you mean? What direction is the character coming from? Do you have gravity enabled and going downward?
In general, if you want your character to “stick” to the object it collides to after they collide, you’ll probably name to create a weld joint between them. Otherwise, if there’s gravity, the character will fall down, since there’s nothing preventing the character from not falling under the influence of gravity.
I hope this helps.
- Andrew [import]uid: 109711 topic_id: 32099 reply_id: 127882[/import]