- Home /
Question by
Gusic · Jul 17, 2015 at 01:49 PM ·
javascript
Input.GetMouseButtonDown no working
i have a get mouse button down script for an sprite for when i click the 2d sprite a level loads. I though it worked but it turns out everywhere i click i load the scene. How do i make it so when i click on the sprite on its own a scene loads.
function Update () {
if(Input.GetMouseButtonDown(0))
Application.LoadLevel("1");
}
Comment
Answer by Mykhaylo-Hnatyuk · Jul 17, 2015 at 02:10 PM
Input.GetMouseButtonDown(0) works just how it should be.
I would recommend you to watch this tutorial https://unity3d.com/learn/tutorials/modules/beginner/ui/ui-button
Your answer
