- Home /
Using Input.touchCount as a button
I'm new to Unity and C#, I've just moved over from Swift and SpriteKit. I'm developing for android, and what I want is to use a button on my main scene to switch to an options menu, then use that same button to switch back to the start menu (if that makes sense!). I've tried this:
void Update () {
if (Input.touchCount > 0) {
Application.LoadLevel ("startScene");
} }
So the two nodes have basically the same input. The problem is, I think because each scene loads instantly that the touch count notices the touch for the first scene in the second scene, so reloads the first scene. So what I want to know is whether there is a better way to make a button or to load the scenes so the touch input isn't getting confused?
I tried to make a button using the create -> button in Unity, but I didn't understand the canvas at all, even after an hours video on YouTube I couldn't get the button to appear in the Unity Remote lol.
Thanks for your help.