Hello guys, I’m 16 years old, and want to make a videogame for Android.
I have a trouble with Input.GetMouseButton (0) and GetMouseButtonDown(0). I don’t know how to make it work, I want the character jump with GetMouseButtonDown(0) (Just click) and with GetMouseButton (0) (Held tap) want to stop. Because it’s a type of infinite runner game.
The character is going to run non-stop with a tap at the start, and while he is running, he can jump. But i want to make it stop too while the person is holding the tap, but I don’t know how to make it works. I made something, but the character stop and jump. I think this happens because both condition come true.
If someone know how to make it works please leave a comment,
thanks!
void Update () {
bool held = Input.GetMouseButton (0);
if(held){
if(held){
Debug.Log ("Held");
}
}
}
When I tap, Both conditions come true