Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question New Input System and PlayerInput

Discussion in 'Input System' started by UglyDuckling, Feb 22, 2024.

  1. UglyDuckling

    UglyDuckling

    Joined:
    Mar 18, 2015
    Posts:
    10
    Hi guys, I'm trying to convert my game to use the new input system, version 1.7. Its a mobile game where I want to use on screen controlls for movement and jumping.

    In my simple example I have a jump controlled by a On-Screen Button mapped to the Control Path "Button South (Gamepad). To execute the jump I have a PlayerInput component with a Unity Event. This is set up as in the few samples I have found.

    The problem is that the Player Input scheme keeps changing back and forth between Touch and GamePad when i touch the On-Screen button. Sometimes cancelling the jump, and making the On-Screen button unresponsive.

    I tried disabling Auto-Switch, setting the default schema to GamePad, but then the On-Screen button does not trigger at all.

    For testing I'm using the simulator game view with "Simulate Touch Input from Mouse" enabled in the Input Debugger.

    I have also tried the On-Screen Stick, with the same type of problems.

    What would the correct way to setup and configure Action, PlayerInput and On-Screen controls? Seems like my sample should be one of the simplest to setup and use, almost out of the box?

    Please help.
     
  2. UglyDuckling

    UglyDuckling

    Joined:
    Mar 18, 2015
    Posts:
    10
    Okey, so I finally got it to work by combining the control schemes for touch and gamepad. Now the player input control schema changes to a Gamepad&Touch schema.