- Home /
Vertical wall friction when character is falling and presses into a wall?
Hey guys,
My character moves with transform.Translate, and the wall colliers have physics2D material, but when the character is falling and the player into the wall it does not fall slower. Any advice on how I would go about solving this issue?
Thanks!
So you want your character to move slower when it collides with a wall?
Does your character have a physics2D material attached to it? Or could it be that your character has a 3D collider? 2D and 3D collider won't talk to each other. A screenshot or a little more info might help :)
I am also having this issue. $$anonymous$$y Character has the "Sticky" material attached to it. I move my character with this code
//NOR$$anonymous$$ALIZE INPUT SO ITS LESS TWITCHY
horizontalInput.Normalize();
//$$anonymous$$ULTIPLY BY $$anonymous$$TATI$$anonymous$$E SO IT $$anonymous$$OVES PER SECOND NOT PER FRA$$anonymous$$E
horizontalInput *= Time.deltaTime;
transform.Translate((horizontalInput.x * 12), 0, 0);
I am trying to have my character stick to a wall when he hits the side of it. I have a sprite with a box collider on it with the Sticky material attached to it as well.
Any Assistance would be appreciated
@benja$$anonymous$$dellarocco what do you mean the "Sticky" material? Is that a material that comes with some Unity asset or did you make that material yourself?
Answer by Shark-Boy · Jun 08, 2015 at 09:30 PM
If you are using Transform.translate the physics2D material will not effect it as Transform.translate overrides the physics. You can use rigidbody2D.velocity to do about the same thing as Transform.translate. So I would look into that. If you need more help feel free to ask.