Question by
daragus_innovations · Nov 08, 2017 at 07:30 AM ·
c#androidplayervelocity
MouseButtonUp not always called
Hi there, I'm currently working on my first game in unity. I'm currently facing the problem that the MouseButtonUp Code seems to not always be called when the user stops touching the screen.
if (Input.GetMouseButtonUp(0))
{
player.velocity = Vector2.zero;
player.AddForce(new Vector2(0, -30));
}
It seems to work for some time, but after 10-45 times it just stops working the code doesn't seems to be called anymore. Any help is really appreciated, because at this point I really just don't know what to do anymore.
Kind regards, Colin
Comment
Answer by daragus_innovations · Nov 08, 2017 at 04:11 PM
Right now I've found out that the programm is in fact not the listener but the code inside it seems like isn't always working. Other code inside the listener is called just fine.