I have a While loop that runs when the mouse is pressed and it look like this:
while (mouseClick.ReadValue<float>() != 0)
{
//Do something
}
This works but I want this to work on mobile instead so I am trying to change this to when a finger is touching the screen. I tried this code:
while (touchControls.Touch.TouchPosition.ReadValue<Vector2>() != Vector2.zero)
{
//Do something
}
That loop starts to run when a finger presses the screen, but it never stops. And touchControls.Touch.ReadValue() != 0 didn't work either. So how can I make it work like I want?
Thanks.