Generating touch programatically

Hello,

I’m implementing a simple replay system. I need to generate touch events, like generate touch event at screen location (100,50) programmatically. I just couldn’t find a way to do it. Any thoughts?

Did you considered to make something like a Wrapper or Adater and use it instead of using of touch input directly? I mean if your game will use touch wrapper instead of Input.touches, you could easy add to this wrapper coulpe of methods to record and simulate touches. :wink:

Something like that would be too painful for me to implement. Somebody must have done something like this, maybe I’m using the wrong keywords.

This kind of wrapper is not difficult to write, just create class with list containing touches and read from this list. If you wan’t to generate event, simply add touch to this list.

More interesting is if you use physic in your game. From my experience I know, that repeating input is not enough to replay physic - you need sample and synchronize physic (you can find tutorials from braid in internet)

found any solution for this?

well this is a post from 2014 so pretty old one to bring back up. But also something i consider to be a XY Problem.

instead of recording and mimicking inputs, the recording should be done on the layer after the inputs, that way you can record only what matters for your replay system.