Quantcast
Viewing all articles
Browse latest Browse all 104

OnMouseDown() Doesn't work

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 :-)

Viewing all articles
Browse latest Browse all 104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>