- Home /
Question by
mdagreda · Aug 20, 2014 at 09:40 PM ·
rotationquaterniondirectionvector
How do I rotate an object to face a direction.
I have a direction an an object and I would like to set the object's rotation so that it will face the direction I have. How would I go about doing this?
Comment
Best Answer
Answer by Suyujin · Aug 20, 2014 at 10:13 PM
If you want it to look at something in particular, try:
void Update() {
transform.LookAt(target);
}
Where "target" is the object you want to look at.
If you want to just rotate the character, check out
http://docs.unity3d.com/ScriptReference/Transform.Rotate.html
Your answer
Follow this Question
Related Questions
Rotating a direction Vector3 by Quaternion 2 Answers
Creating Hint Vector 1 Answer
How can I move an object to click point in 2D? 0 Answers
Rotate object to target position 1 Answer