(UNITY3D) Get slerp to work just as LookAt(,Vector3.right) does

Posted by Ben Rokah on Stack Overflow See other posts from Stack Overflow or by Ben Rokah
Published on 2012-10-11T15:06:30Z Indexed on 2012/11/06 5:01 UTC
Read the original article Hit count: 175

Ive been working over a sidescroller shooter game. Ive got my sidescroller shooter character to look around with these :

chest.LookAt(mousepos,Vector3.right);

&

chest.LookAt(mousepos,Vector3.left);

(Left when the character is turned to the left and right when the character is turned to the right)

so it wont aim in to any other axis... But when the mouse gets to cross the middle of the character and not around it it gets the rotation to make a small transportation between frames and it wont get all the way to there.. It'll just teleport to its correct rotation like lookat should.

Well the question is, how do I get any quaternion slerp which works with a Time.deltTime to work as same as LookAt(,Vector3.right)? I must have the Vector3.right and left so it'll move trough 1 axis.

Many thanks to anyone who helps me out. :)

© Stack Overflow or respective owner

Related posts about transform

Related posts about unity3d