Quantcast
Channel: Questions in topic: "ads"
Viewing all articles
Browse latest Browse all 1416

reset touch input from C# code?

$
0
0
Hello, I'm building a game, where when the user dies he/she will sometimes be able to watch a rewarded video to continue. My player character is controlled by tapping on the screen, so when touch is down, the player moves down. When not touching the screen the player moves up. I'm having a problem after my reward video finishes, sometime it seems that the touch is detected as the screen is being touchen when it isn't. if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) i.e. the if statement above would normaly be false when not touching, but for some reason sometimes it is true when the rewarded video ends. This means that the player moves down instead of up, which is very confusing for the person playing the game. So my question is, are there some way with C# code to "reset" the screen/touch, or force re-detection of the touch input?

Viewing all articles
Browse latest Browse all 1416

Trending Articles