Hello, I usually never have problems with this, but somehow I can't get the OnMouseDown() to work. This is my code:
using UnityEngine;
using System.Collections;
public class Menu : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnMouseDown() {
Debug.Log("Clicked");
}
}
I have tryed with other stuff instead of Debug.Log("Clicked"); but it doesn't detect the click at all.
I have a collider on my gameobject.
The script is attached to the same gameobject as the collider.
I don't know what can be causing this, but that's why I ask here ;)
Thanks, Andreas :-)
↧