- Home /
 
 
               Question by 
               karma0413 · Mar 26 at 01:21 PM · 
                vector3vector math  
              
 
              Best Practice for rotating a Vector3, x degrees?
Basically, I want to take a Vector3 direction and rotate it x Degrees and get back a Vector3 direction?
 
 For Example
 Vector3.forward = 0,0,1
 
 If I want to rotate to the left 45 degrees, the final Vector3 is (-1, 0, 1)
 If I want to rotate to the left 90 degrees, the final Vector3 is (-1, 0, 0)
 
 Previously, I have been using the method: Quaternion.AngleAxis, but is there a better way using Vector3 math or logic to achieve the same thing?
 For Example:
 Vector3 currentDirection = Vector3.forward;
 // if I want to rotate left by 45 degrees, I have been using this method
 Vector3 newDirection = Quaternion.AngleAxis ( -45f, Vector3.up) * currentDirection;
 
              
               Comment
              
 
               
              Answer by HappyPixel27 · Mar 26 at 09:26 PM
you could use transform.rotate. Not sure if thats what your asking.
Your answer