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

Can I simulate a touch/click in a certain screen position via script?

Discussion in 'Editor & General Support' started by FelipeTraesel, May 17, 2017.

  1. FelipeTraesel

    FelipeTraesel

    Joined:
    May 17, 2017
    Posts:
    3
    Hello all,

    I'm developer for Android devices. My question follows:

    I'm saving logs from what the user do in the app. As so, I am saving the touches the user do in a specific file, with the intention of being able to reproduce the exact same commands afterwards, in case some bug or crash happens.

    So, lets say that I stored the position 100x100 of the first touch, and five seconds after, the user touched position 500x300. I want to read this file afterwards, and trough code, be able to re-do the user touches, and so, would like to "simulate" a touch in the position 100x100 and five seconds after "simulate" a touch in 500x300. This "simulation" of touches would be ONLY IN THE EDITOR, as the reason for this is to debug errors that may appear.

    I've done a lot of research in forums, but couldn't find. Would really appreciate if someone has a hint on this. Thanks to all that spent time reading my thread.

    Best regards.
    Felipe
     
  2. Arajar1

    Arajar1

    Joined:
    May 17, 2017
    Posts:
    4
    I am really interested in this, did you manage to send touches programmatically?