- Home /
stairs in 2d platformer unity 4.3
I have a 2d platformer, I use rigidbody2d for the player.
I want to make stairs but I cant do it realistic. what I did was to create a rotated boxcollider2d, the problems are: 1. when the players walk down the stairs, it's not really like he's walking down the stairs, it's more like he's skipping them or jumping over the stairs. 2. when the player stands on the stairs and there is no horizontal keyboard input, the player is sliding down the stairs. 3. If I move the player up the stairs with the key and then I release the key, the player makes a small jump.
Any help? Thanks!
Answer by Spinnernicholas · Nov 27, 2013 at 04:53 PM
1 and 3 are because your character is moving too fast.
To fix 2, you need to work with the PhysicsMaterial2D on the colliders of both your stairs and character. PhysicsMaterial2D allows you to change the friction of the collider.
http://docs.unity3d.com/Documentation/ScriptReference/PhysicsMaterial2D.html
Also, it might work better for you if you turn off physics and manually move your character while he is on the ground and to only enable physics when your character isn't grounded.
Your answer
Follow this Question
Related Questions
Problem with rotated colliders 0 Answers
animation 2d platformer 2 Answers
jittery jumping 2D character 0 Answers
switching between different screen boxes 2 Answers
2D Buttons 1 Answer