I have implemented moving my character using Contact.TangentSpeed
(something similar to this: http://www.iforce2d.net/b2dtut/conveyor-belts):
foreach (var contact in GroundContacts)
{
contact.Contact.TangentSpeed = -MaximumVelocity;
}
Unfortunately, when I move my character to a place like this:
It moves into the walls instead of stopping. If I press character with ApplyForce
, everything is ok though.
How to make it stop instead of moving into the wall, without explicitly checking for previously described situation?
I think it might be important to note, that the black bodies are static.