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
  3. Dismiss Notice

Question Immediate InputAction call after switching ActionMap

Discussion in 'Input System' started by L_Rei, Jan 18, 2021.

  1. L_Rei


    Oct 20, 2018
    Hi everyone!

    I have a problem with switching InputActionMaps.

    First of all, I don't use the PlayerInput component and wrote my own input manager switching InputActionMaps manually with Enable() and Disable() and it's working fine so far.

    But now I added a map (for our construction system, where you can place objects in the game world) that uses the same inputs as another map (basic world interactions like using items, picking up stuff, etc.).
    That's no problem in general, but leaving the construction mode is triggered by the same input as consuming an item in world mode. This action is triggered immediately after the new map is enabled. All inputs have the action type "Button" and have a "Press Only" interaction.

    Any ideas on how to prevent that?

    What I already tried:
    Waiting for one frame before switching maps, so there is no "key down" in the frame where the new map is enabled. (Changes nothing)
    Changed the leave construction input from "press only" to "release only". (Fixes the problem in most cases, but it still happens from time to time and it's not what I want^^)

    Thanks in advance! <3