Player sticks to walls even with physics material
I've made a physics material 2D that has 0 friction and I've applied it to the rigidbody of the character, the box collider, and the tilemap collider and any variant of that so my player stops sticking to walls instead of sliding down. However, it doesn't work. What else can I do? Here's the player script if needed. Thanks!
Answer by xxmariofer · Feb 13, 2019 at 09:06 AM
hello, change the fixedupdate lines to something like this, and adjust the new speed value. also take into account that having the inputs catch in the fixedupdate is not a good idea.
rb2d.velocity += -Vector2.right * Speed * Time.deltaTime;
Ah, I can now slide! The only issue is, I can't stop sliding no matter where I put the material, any other ideas? thanks for that one tho!
what do you mean stop sliding? When facing a wall, or in a slope? can you give me an example?
Just whenever I move basically. $$anonymous$$y level is a flat plane with a wall at one end, and I was sliding like on ice when on the flat if I tapped a movement key. I got around it by making a box collider around the wall and applying the material to only that. Thanks!