Search Unity

Question New Input System issues with Touch Input and Cinemachine

Discussion in 'Input System' started by isabelle_go, Dec 1, 2022.

  1. isabelle_go

    isabelle_go

    Joined:
    Mar 23, 2016
    Posts:
    1
    Hi!
    I have been battling with the new input system / touch simulation / cinemachine for the past few days and am not really sure what it is that I'm doing wrong.

    I am using the new input system, with a custom InputActionAsset, UCAInputActionAsset.
    Then, I have a character controller, with a PlayerInput compenent, using this UCAInputActionAsset.
    upload_2022-12-1_11-46-13.png

    I have a Canvas with a few UI elements, one of them being a Jump button. This Jump button has a "On-Screen button" component attached to trigger the Jump action is defined in my UCAInputActionAsset.
    The event system has an InputSystemUIInputModule. Now to get my jump button to work and trigger the jump action, I had to set the DefaultInputActions as actions asset in this InputSystemUIInputModule, not entirely sure why, but it was the only way it worked.
    upload_2022-12-1_11-47-40.png

    My first problem is the following: this all works fine in the editor, but if I run a build on device (Android in this case), the jump action is never triggered (although the button is visibly pressed)


    Next, I am using Cinemachine and a FreeLookCamera, both as a 3rd person camera by default, and as a free look camera around the player when input is detected. To get the freelook behaviour, I added this component to my virtual camera:
    upload_2022-12-1_11-55-51.png

    I can see that the FreeLook action is being triggered, BUT it is not moving the camera at all. One potential reason for it might be that it is triggered twice, once with zero values.
    This is logged from the OnFreeLook event callback I have on my Player:

    In order to get the action to be triggered though, I did have to add a PlayerInput component to the Camera (configured exactly like the one on my Player character)

    EDIT: I managed to solve my second problem and get the FreeLook input to be registered, by creating my own InputProvider script.
    Now this works great in the editor but again, it doesn't work on device.


    But it's not look input is not at all detected, EnhancedTouchSupport is working, I use it for my joystick. And I can see buttons being triggered. What seems to be the problem is triggering actions from my custom InputActionAsset.
    However, I am not sure what to try/do about this.

    Any help would be greatly appreciated! :)
     

    Attached Files:

    Last edited: Dec 6, 2022