- Home /
OnMouseDown not working when deployed
Hi Guys,
I have an opening scene for my game with a GUIText object in the middle of the screen. I have a script attached which simply contains:
private void OnMouseDown(){
Application.LoadLevel("Prototype");
}
This works fine when I run the game in Unity however when I deploy it doesn't seem to work. I am deploying as a standalone application for Mac OSX.
I've been tearing my hair out over this for an hour or so now and its starting to do my head in!!!
Thanks guys.
Answer by Jessica_Ann · Jun 15, 2012 at 07:57 PM
Make sure that the level "Prototype" is including in the build scenes. If it is not then it will not work.
Answer by DarKKendO · Jun 17, 2012 at 07:43 PM
All the scenes are added in Build scenes. Its becoming a weird problem. I've managed a workaround by implementing a raycast and now it works fine using that. I'd still like to solve it though.
Funny thing is, I made a new scene and added a GUIText object with the same code above and it works fine however if I duplicate the scene it doesn't work. Theres obviously something in my scene messing with things. Tearing my hair out trying to get it solved :(