I have a player that launches off a ramp. Everything works fine until that point.
When the player is off the ramp they are looking a little upwards so what I am trying to do is smoothly change the player (X, Y, Z) rotation; from the current one to a new one.
I always need y = -180
I always need z = 0
I need x = (MinAngle, MaxAngle) -> maybe these values (-30, 30)
Reason For X(MinAngle, MaxAngle)
I am trying to figure out how to rotate player on certain axis smoothly and stop at a certain angle so it can be applied here and possibly with player Buttons(Up/Down)
The transform.rotation Line Causes the Issue
rotCur = Quaternion.FromToRotation(transform.up, hit.normal) * transform.rotation;
transform.rotation = Quaternion.Lerp(Quaternion.Euler(30,-180,0), rotCur, Time.deltaTime * 5);