I have an issue with the OnMouseDown() event. The object this script belongs to is a computer cabinet which can be clicked to execute certain actions. But i'm stuck right on square 1.. I have tried to search the web for this issue for some time now, but allmost nobody seems to have the same issue, and other solutions have not been working perfectly. Can anybody please help me? I'm confused..
public class ComputerScript : MonoBehaviour
{
private RotateForDisplay displayRotation;
private GameObject displayObjects;
private void Start()
{
displayObjects = GameObject.Find("DisplayObjects");
displayRotation = displayObjects.GetComponent<RotateForDisplay>();
}
// This does not seem to work for some reason..
private void OnMouseDown()
{
displayRotation.isRotating = false;
Debug.Log("Mouse is down");
}
}
Check the following points:
Hope it helps, good luck!