hello I’m trying to make a prefab rotate when I click on it based on the mouse when I click. I am using this script
using UnityEngine;
using System.Collections;
public class Rotate: MonoBehaviour
{
public float RotationSpeed=1000;
void Update(){
}
void OnMouseDrag(){
transform.Rotate((Input.GetAxis("Mouse Y") * RotationSpeed *Time.deltaTime), (Input.GetAxis("Mouse X") * -RotationSpeed *Time.deltaTime), 0, Space.World);
}
}
it works perfectly fine with simple cubes but when I use it on a prefab it doesn’t do anything. Would love some help. thanks.