problem when rotating a prefab

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.

For one, I would not call this class Rotate. You are asking for trouble. Make it SimpleRotate, or something thats different from central function of Transform. I cant see any reason for it to not work with a class name like this, but still, its bad coding standard.

As for why its not working. Impossible to know without seeing your scene setup

seems like I solved my problem by adding a collider with trigger to my object.