Hi,
I’m currently planning an FPS game with non smooth terrain and I’m trying to figure out how to make the movement speed consistent when the character is facing uphill.
On plains it’s easy since the movement vector is always aligned with the X and Z axes, but on hilly terrain the movement vector needs to be aligned with the face under the character feet.
Is there a way to get the specific face from the colliding mesh, and get it’s angle?
If not, there is a way to make it without using CharacterController class? I really don’t want to use it since I need to have full control of the movement aspect.
Do a raycast straight down from your player. The RaycastHit contains a normal
property describing the surface normal at the point where the raycast hit.
1 Like