Question by
A_R_T_A_G_E · Nov 10, 2015 at 07:47 PM ·
mouseonmousedownvoiddown
What I do wrong ? (OnMouseDown)
What I do wrong ?
using UnityEngine;
using System.Collections;
public class OMD : MonoBehaviour
{
public GameObject Object ;
void OnMouseDown(Object.gameObject)
{
Debug.Log("Done");
}
}
Comment
Best Answer
Answer by DoTA_KAMIKADzE · Nov 10, 2015 at 07:48 PM
void OnMouseDown(Object.gameObject)
to
void OnMouseDown ()
And also make sure you can actually click on the object that contains this script (e.g. GUI, collider component).
You can check out THIS video tutorial for visual guidance.
Your answer
Follow this Question
Related Questions
Disable mouse click on gameObject 1 Answer
OnMouseDrag() stopped working after few clicks 0 Answers
How do I use Input.GetButton, instead of OnMouse() 1 Answer
Void cannot be used in this context, unexpected symbol expecting `,', `;', 0 Answers
Why is my MouseLook script not letting me look up? 0 Answers