I can spin a cube or sphere but when i attach the script to empty GameObject it’s not doing anything.
In the screenshot i have in the Hierarchy empty GameObject i called it Elevator. If i attach the script to the Elevator nothing happen when i drag the mouse.
But if i attach the script to the Platform(Cube) or to the Sphere it will spin them.
But i want to attach the script to the Elevator and when i will drag the mouse it will spin the whole GameObject and his childs as one unit. And not only one object.
The script
using UnityEngine;
using System.Collections;
public class ObjectRotate : MonoBehaviour {
public float multiplier = 10f;
void OnMouseDrag()
{
transform.Rotate(Input.GetAxis("Mouse Y") * multiplier, -Input.GetAxis("Mouse X") * multiplier, 0, Space.World);
}
}