When players tap my “main menu” button, they also usually end up activating my “play” button. The “main menu” button loads another scene, and another button appears in the same spot as the “main menu” button called “play”. For some reason, if the player holds down their finger on the first button, it will also count as them pressing down on the next button unless they very quickly remove their finger. How can I make the players touch input count only once, so that the player doesn’t misnavigate. my scene loading for the button presses is here:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class playAgain : MonoBehaviour {
public string levelToLoad;
public bool alreadyTapped;
public void OnMouseDown(){
//use on mouse up to set bool?
if (alreadyTapped == false) {
Application.LoadLevel (levelToLoad);
alreadyTapped = true;
}
}
public void OnMouseUp(){
alreadyTapped = false;
}
}