- Home /
Is transform.rotation in Quaternions?
This should be a quick answer. In this function:
public static Quaternion Slerp(Quaternion from, Quaternion to, float t);
'from' and 'to' need to be quaternions, so this is the question:
is transform.rotation in quaternions? so in other words, can I do this:
Quaternion Slerp(current.rotation, target.rotation, t);
Tyvm!!
Try reading Scripting API, it helps in cases like this one. The type of property is described right in the first string. :)
Answer by Giobar97 · Jan 11, 2015 at 03:33 PM
Yes, it is. You can use your code as you wrote above. In the future, if you'll need to check things like that, just write, in your case, "gameObject.transform.rota". A little list will be displayed with the automatic completion, and it will show you also more information about the method, as the kind of the variable, which in your case is what you need.
Your answer
Follow this Question
Related Questions
Difficulty making a complex camera rotation 2 Answers
Quaternion.Slerp not smooth! 0 Answers
Quaternion slerp t parameter never reaches 1 1 Answer
Interpolate rotation of character. 0 Answers
Misbehavior with Quaternion.Slerp 3 Answers