- Home /
 
               Question by 
               mustang4484 · Nov 19, 2018 at 08:59 PM · 
                vector3transform.rotationlocalpositionlocalrotation  
              
 
              Transfer axis global rotation on local axis of another object
Hi guys
I have a camera that I move with the middle button of the mouse, and I have an object that follows the same rotations but only locally. I would like the z axis of the object ( global) take only the local rotations of the camera on the y axis.
Can you help me?enter code here
 if (Input.GetKey(KeyCode.W))
         {
             Debug.Log("spostato");
             transform.localPosition += Vector3.forward * Time.deltaTime * speed;
         }
 
 
         transform.rotation = target.rotation;
  
               Comment
              
 
               
              Your answer
 
 
             Follow this Question
Related Questions
rotated position, together with the object (around the origin) 0 Answers
Point game object to another only on the Local X Axis 0 Answers
Script won't set right rotation? 1 Answer
transform.eulerAngles of camera - changing the speed of rotation not working? 1 Answer
How can i change a childs local position with a variable? 1 Answer
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                