How do I stick my player to a wall? How do I get my player to stick on to a game object and move on it?
I'm trying to incorporate wall riding into my game but don't know the script or things to make it happen. So I'm trying to make a game that would involve wall riding but I don't know what script I could maybe use to make the player stick to the wall. I'm a little new to unity so I'm not sure what to do.
Answer by lgarczyn · Nov 21, 2019 at 11:12 PM
To stick to walls, the usual system is simple:
Check that the player is next to a wall, but not on the ground
Check that the player is pressing the left/right arrow depending on the wall's direction
If both are true, apply a smaller gravity, and a limit to the downward velocity
Set the animation to the wall slide, and set a wallSlide book to true to make sure the next jump will go the opposite direction