I swear this used to work before but isnt touch input (input.touchCount and input.GetTouch) supposed to work with mouse clicks too? Specifically for testing so I don’t have to add extra mouse checks or export to a touch device every time I wanna test the game.
Don’t remember having this problem a year or two ago, I remember mouse clicks conveniently mimicking touch right out the gate. Did they change something? Or am I forgetting to set something up after a fresh install of unity?
I didn’t edit Input.simulateMouseWithTouches at all, and printed its value to console just to be sure in the update loop right before the touch check code. It prints true. So i don’t know why it’s not working anymore
Solved. I did forget something. Have to run it in the simulator view, not the default game view.
Simulator view sounds interesting. What I wonder most: Can we test multitouch somehow without compiling to a touch device all the time?
With my assets these test were by far the most time consuming ones. So I wonder, could I maybe record some multitouch-gestures somehow, then run the game in Unity editor, play back the recorded gestures and then check with testing framework, if everything behaves as expected? Like: did the virtual joystick move that far, did the camera turn roughly that angle? (with 1 finger, with 2 fingers, with 3 fingers, …) Did the player approximately move to the expected position, did the item move to the quick access button? Does it tigger correctly, etc.?