- Home /
Question by
RinValak · Apr 04, 2013 at 08:32 AM ·
mouseclick
OnMouseDown doesn't work
The below code is attached to my game object. That game object has a collider. Clicking it in-game has no effect. I also tried making it just debug log, but it's not recognizing the clicks at all. Could this be related to having an Orthographic camera? I'm probably missing something really really obvious. Thanks in advance.
function OnMouseDown () {
Application.LoadLevel ("MainMenu");
}
Comment
Ok yeah it works fine in perspective camera. I'll try a few tweaks, but I may need to do a raycast.
Best Answer
Answer by RinValak · Apr 05, 2013 at 05:15 AM
Figured it out. If you're using an Orthographic camera and your near clipping plane is too far in the negative it freaks out OnMouseDown.
Your answer
