Question by
extrem7 · Oct 06, 2018 at 11:53 AM ·
3drotate objectvector3.lerp
LookRotation in one global axis insted transform.Rotate
I rotate my player in this way :
Vector3 direction = Vector3.RotateTowards(transform.forward, rotateVector, 0.2f, 0.0f);
transform.rotation = Quaternion.LookRotation(direction);
rotateVector it's normalized vector. I need to rotate another object together with my player, but this object may have rotation in X and Z axes, so when i use LookRotation it's reset X and Z to zero.
How can i rewrite transform.Rotate(Vector3.up * 1f) to LookRotation or Lerp?
Comment