Hi all, I am trying to implement a sliding system in my 3D game but I am having some difficulty. Currently I am using Mathf.Lerp() to interpolate between two different speeds of sliding so that the player appears to slow down over the duration of the slide. While this works, it doesn't give the most desirable effect, I would like to make it so that the slides duration is dependent on the gradient of the surface that they are on. For example, if they are on a hill, the player would continue to slide until the gradient flattens out again. How would I begin going about this? Many thanks in advance.
I think you want the raycasthit.normal on the ground then getting the vector3.angle between the normal and the player.forward or the vector3.up more on this: 1 2 3