- Home /
Moving Rigidbody up slopes/stairs
As the title suggest, I want to move the rigidbody up and down stairs. I've seen a couple cases where they suggest putting ramps on the stairs but this won't work as the player has their own gravity script and could be walking on the ceiling or wall for example and I can't cover up every potential step with a ramp.
The step check would have to work with the transform's orientation. I move the rigidbody with velocity directly.
Comment
when colliding with a wall create a ray from a start point that will be the max height of the stair, in the vector.right of the player direction, if the player is colliding but the ray dont hit anything you can use the rigidbody.movepositon for going upwards