- Home /
 
 
               Question by 
               raja1250 · Jun 26, 2015 at 11:55 AM · 
                rotationrotate object  
              
 
              Rotate object respect other object rotation
I need to rotate a game object to the exact opposite rotation of another game object
               Comment
              
 
               
              What do you mean? like When an object is being rotated another object do an opposite rotation like in a mirror or something? I can make you that code. just make things clear here.
 
               Best Answer 
              
 
              Answer by Hellium · Jun 26, 2015 at 12:04 PM
Your problem is not very clear.
If I understood right, this is what I would have done :
 // C#
 public GameObject object ;
 public void Rotate()
 {
     // Flip the rotation on the 3 axis
     transform.rotation = object.transform.rotation * Quaternion.Euler( 180, 180, 180 ) ;
 }
 
              Your answer