I’m having some issues trying to make the touch system to work with the new input system. This is my current setup:
And my testing code:
void Start()
{
m_cameraControls = new CameraInput();
m_cameraControls.Enable();
m_cameraControls.CameraMovement.TouchPoint.canceled += TouchPointOncanceled;
m_cameraControls.CameraMovement.TouchPoint.started += TouchPointOnstarted;
m_cameraControls.CameraMovement.TouchPoint.performed += TouchPointOnperformed;
}
void TouchPointOncanceled(InputAction.CallbackContext obj)
{
Debug.Log("Touch Canceled");
}
void TouchPointOnstarted(InputAction.CallbackContext obj)
{
Debug.Log("Touch Started");
}
void TouchPointOnperformed(InputAction.CallbackContext obj)
{
Debug.Log("Touch performed");
}
The problem is that started and performed are getting executed on start and just once (canceled is never called). Doesn’t matter how many tiems I touch the screen they are no longer called. I’m trying to get an Action when the screen receives a new input touch. How can I achieve this functionality?