Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question Disable gamepad joysticks / Dpad

Discussion in 'Input System' started by larswik, Feb 19, 2023.

  1. larswik

    larswik

    Joined:
    Dec 20, 2012
    Posts:
    312
    Hi, I use my Gamepad on 2 Scenes, Game play scene and main menu scene. On the main menu I only want the dpad to cycle through the buttons, but right now both joysticks also cycle through the buttons. How do I disable just the joysticks from any input while on the Main Menu Scene? I have tried the obvious code, but it doesn't seem to work. Thanks!

    Code (CSharp):
    1.         playerControls = new PlayerControls();
    2.         playerControls.GamePlay.RotateLeft.Disable(); // one of the joysticks
     

    Attached Files:

  2. rdjadu

    rdjadu

    Joined:
    May 9, 2022
    Posts:
    103
    Point InputSystemUIInputModule to your own actions (can copy the UI section from DefaultInputActions) and customize the Move action to no longer include the sticks.
     
  3. larswik

    larswik

    Joined:
    Dec 20, 2012
    Posts:
    312
    Thanks rdjadu, I will look into that.