Hello and thank you for reading my question!
Is there a way I can programmatically trigger a Touch at a specific position?
I found this in the docs:
public void NewTouch()
{
// Create a touchscreen device.
var touchscreen = InputSystem.AddDevice<Touchscreen>();
Debug.Log("testing simulate touch");
// Send a touch to the device.
InputSystem.QueueStateEvent(touchscreen,
new TouchState
{
phase = UnityEngine.InputSystem.TouchPhase.Began,
// Must have a valid, non-zero touch ID. Touchscreen will not operate
// correctly if we don't set IDs properly.
touchId = 1,
position = new Vector2(0, 0)
// Delta will be computed by Touchscreen automatically.
});
}
This does not give me the Touch right away - the Touch is queued. I’m looking for the Touch to fire away immediately.
Is there a way to accomplish this with input actions?
Thank you for reading! Please help me