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.

Question [Solved] Change action map while holding button and reset on release

Discussion in 'Input System' started by King_of_L1mbs, Nov 20, 2022.

  1. King_of_L1mbs

    King_of_L1mbs

    Joined:
    Jun 15, 2019
    Posts:
    18
    I am trying to wrap my head around controling a radial menu. When I hold a button (e.g. right shoulder/RB) I need to stop the left stick to move my character and navigate the menu instead. But what happens on changing the action map by pressing/holding RB is it gets immediatly canceled and wont register its release on letting it go after that to close the menu. Of course I could code that functionality into/around my movement action map but then what would I need an action map for at all - doesn't feel like doing it right.
    Is there any way to carry over that pressed state to the UI action map so I can find out when its released?
     
  2. King_of_L1mbs

    King_of_L1mbs

    Joined:
    Jun 15, 2019
    Posts:
    18
    Alright, figured it out myself. On the UI action map for the menu button action check the box "Initial State Check" which registers the button as held after switching to the map. This is turned off by default.