- Home /
Question by
thedodgeruk · Jul 30, 2012 at 06:28 PM ·
rotationvector3degree
is there any code that will rotate a vector3 by an angle?
i have a facing vector3 of (0,0,1) for example
i want to rotate it (-90 +angleNeeded , 0,0);
so that it will rotate the vector3 in a x axis by the degrees i need
Comment
Best Answer
Answer by ScroodgeM · Jul 30, 2012 at 06:38 PM
Quaternion q = Quaternion.eulerAnles(-90f+angleNeeded,0,0); Vector3 rotated = q * Vector3.forward;
Your answer
Follow this Question
Related Questions
Problem with normal snapping and rotations. 1 Answer
add force in a particular direction 0 Answers
How to smoothly rotate to certain directions using input axis 1 Answer
rotate vector around local axis 2 Answers
0-360 Y degree from Vector3.Angle 1 Answer