I have been looking at box2d as good choice for my latest project.
However I have run into a bit of a problem.
Now the player is nothing more than a box, and when that box hits a sloped surface, for example another box that is static and doesn't ever move, this is the ground for the level and there are many of these.
I realize that this would be a desirable effect for a normal box, however the player though represented as a box isn't a box at all and I even have it set for fixed rotation.
As such I do not wish for it to be sliding down slopes on its down, but rather when it hits the ground I would wish it for it to stop and not move anymore until I press any keys.
So far sitting the friction very high seems like a hacked solution, although it does prevent the sliding down part.
But this arises another problem, as I have other box's that are present in the level hitting the player and I wish for these to for example push the player around and down slopes, sitting the friction high enough to prevent the sliding also prevents this.
So long question short.
How do I tell the player box to stop on any sloped surface and not to move anymore on its down?
Or maybe a better question would be how do I tell it to not slide down surfaces that have zero density?
Any information at all on this would be must appreciated 🙂
However I have run into a bit of a problem.
Now the player is nothing more than a box, and when that box hits a sloped surface, for example another box that is static and doesn't ever move, this is the ground for the level and there are many of these.
I realize that this would be a desirable effect for a normal box, however the player though represented as a box isn't a box at all and I even have it set for fixed rotation.
As such I do not wish for it to be sliding down slopes on its down, but rather when it hits the ground I would wish it for it to stop and not move anymore until I press any keys.
So far sitting the friction very high seems like a hacked solution, although it does prevent the sliding down part.
But this arises another problem, as I have other box's that are present in the level hitting the player and I wish for these to for example push the player around and down slopes, sitting the friction high enough to prevent the sliding also prevents this.
So long question short.
How do I tell the player box to stop on any sloped surface and not to move anymore on its down?
Or maybe a better question would be how do I tell it to not slide down surfaces that have zero density?
Any information at all on this would be must appreciated 🙂