Object Fallow Y axis !

hey guys i was wondering if you could please help me. Basically i have two cubes one that contains my Mouselook script and one that has nothing. Now what i want to do is if the player looks up and down on the Y axis i want the other cube to fallow the up and down directions can someone please help me thank you :slight_smile:
I would really appreciate it.

Here is my mouse look script:

	public enum RotationAxis {MouseX = 0, MouseY = 1}
         
         var RotationAxisRotationXY = RotationAxis.MouseX | RotationAxis.MouseY;
         
         //We are defining the variables needed for our X axis motion. This will include 
         //Sensitivity and the minimum and maximum of the x axis rotation 
         
         var sensitivityX : float = 400f;
         
         var minimumX : float = -360f;
         
         var maximumX : float = 360f;
         
         var RotationX : float = 0f;
         
         var OriginalRotation : Quaternion;
         
       var Game : Transform;
        
         // Now lets set the variables for the y axis so the player can then look up and down
         // using the mouse.
         
         var RotationY : float = 0f;
         
         var minimumY : float = -25f;
         
         var maximumY : float = 25;
         
         var sensitivityY : float = 400f;

    
function Update () {

   

      if(RotationAxisRotationXY == RotationAxis.MouseX){
       
      	RotationX += Input.GetAxis("Mouse X") * sensitivityX * Time.deltaTime;
      	
      		
      		
      		RotationX = ClampAngle (RotationX, minimumX, maximumX);
      		
      	    OriginalRotation = XQuaternion = Quaternion.AngleAxis (RotationX , Vector3.up);    
             
             transform.localRotation = OriginalRotation * XQuaternion;
             

			}
			if(RotationAxisRotationXY == RotationAxis.MouseY){
			
			RotationY -= Input.GetAxis ("Mouse Y") * sensitivityY * Time.deltaTime;
			
			RotationY = ClampAngle (RotationY, minimumY, maximumY);
			
			OriginalRotation = YQuaternion = Quaternion.AngleAxis (RotationY, Vector3.right);
			
			transform.localRotation = OriginalRotation * YQuaternion;
			
		
			
			}
		
	       

    
         
}

		
				
	
	
	static function ClampAngle (Angle, min, max): float {
	
	
		if(Angle < -360){
		Angle += 360;
		
		}
		if(Angle > 360){
		
		Angle -= 360;
		}
		
		return Mathf.Clamp (Angle, min,max);
	}

The variable var Game : Transform; is a reference to the cube that is meant to fallow the other cubes Y axis :slight_smile:
Thank you in advance :slight_smile:

If you rotate Cube A up on the Y axis, you want Cube B to move up on the Y?

Place Cube B insid of Cube A, Restrict its X and Z motions and freeze its rotation.