How to cancel the force caused by collision? So the player is not pushed away when it hits a corner?
Hello. I am working on a 2D platformer game. One behavior of the character colliding onto the corner of a collider troubles me. Imagine the circle is the collider for the player with dynamic rigidbody and box is a platform with box collider. I want the player to be able to jump onto the platform with this slightly off positioning.
The behavior I want to achieve:
However, apparently with unity's physic system, upon collision, a force pushes the player away from the platform.
In reality, this is what happens:
I am applying other forces to the rigidbody of the player object at the same time, therefore I have to keep the body type as dynamic. I have already set all the materials to 0 friction and 0 bounciness. I also don't want to cancel the collision directly as that way the player will overlap with the platform.
I want to know if there is any way to disable or cancel out the force caused by collision, or any other workaround method to achieve this kind of behavior.
Any advice or thought is appreciated!
Just to mention that I have also tried to round the corners of the colliders, but it didn't help.