Question by
shahinrostami · Aug 17, 2017 at 09:31 AM ·
rotationrotate objectrotation axisrotating
How to only slerp Y and Z, whilst independently rotating X
Hello
I'm using
Quaternion transformRotation = Quaternion.Slerp (transform.rotation, Quaternion.LookRotation (movement.normalized), 0.6f); transform.rotation = transformRotation;
To rotate my character in the direction they're moving.
However, when jumping, I'm also applying
transform.Rotate (new Vector3 (50, 0, 0));
To give tha appearance of a somersault. (Keeps rotating until landing).
The trouble is when using them both together (when moving whilst jumping) it only appears to rotate forwards slightly.
I've searched these forums and tried to implement the supposed fixes but they didn't work for me.
Any ideas?
Comment