- Home /
Rigidbody2D character movement problem
Hello everyone! I just started to make a platformer game, but I already got a problem with the character movement. I use rigidbody2D, alter it's velocity for horizontal movement, and use the AddForce method to jump. My problem is, that the character gets stuck on the walls, if I move it horizontally in the air. Could someone let me know, how should I get rid of this problem? Thanks for the answers!
Add physic materials with little friction to both the object's and the wall's colliders.
Answer by Vladimir-Shafran · Aug 12, 2014 at 05:55 AM
I really don’t know what type of collider you are using, but
You can try use Circle Collider 2d or Capsule Collider in the place when your character has collisions with the walls. Something looks like on this image http://answers.unity3d.com/questions/347120/early-collision-above-character-controller.html http://docs.unity3d.com/Manual/class-CapsuleCollider.html
You can change a Friction parameter in settings of material http://docs.unity3d.com/Manual/class-PhysicsMaterial2D.html
Changing the Friction to 0 worked just fine, thank you! :)