Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

How do I test touch on PC?

Discussion in 'Input System' started by Fleegsta, May 12, 2022.

  1. Fleegsta

    Fleegsta

    Joined:
    Apr 29, 2022
    Posts:
    7
    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?
     
  2. Fleegsta

    Fleegsta

    Joined:
    Apr 29, 2022
    Posts:
    7
    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
     
  3. Fleegsta

    Fleegsta

    Joined:
    Apr 29, 2022
    Posts:
    7
    Solved. I did forget something. Have to run it in the simulator view, not the default game view.
     
  4. stuepfnick

    stuepfnick

    Joined:
    Apr 19, 2017
    Posts:
    18
    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.?