Forum rules - please read before posting.

Switching the action map of the new input system

Hi, we are currently using the adventure creator to create a nintendo switch game for the Unity version 2022.3.15. We are using the new input system and have implemented multiple action maps for different situations, for example when a minigame is activated. Inside Unity the action maps are working parallel and I don't have to switch anything, but as soon as I load the build onto the nintendo Switch the action maps that aren't the players aren't working anymore. I also can't seem to switch the active map any way. Controls that are located inside scenes without adventure creator logic are still working fine.
Is there a way to switch the maps or do I have to implement it another way?

Comments

  • Are you using AC's Input System integration available on the Downloads page?

    The Action Maps are not directly referenced by AC - you'd need to call their Enable/Disable functions through script if you wish to control their enabled states.

    A similar issue, with sample script, can be found in this thread.

  • Thank you for the quick awnser.

    Yes I am using AC's input system integration.

    I already tried similar approaches and this one finally can switch the action maps in the unity editor. But when I am on the switch I still can't get any inputs to work. I already tried different mappings (switch controller, pro controller, gamepad).
    The player however is able to move when I don't deactivate the player map.

  • edited March 26

    this one finally can switch the action maps in the unity editor.

    What approach/code specifically is working?

    If things are working in the Editor, but not the Switch, it may be an Input System bug.

    Controls that are located inside scenes without adventure creator logic are still working fine.

    Does switching Action Maps in non-AC scenes also work?

    To be clear: only one Input Actions asset is referenced, with all Action Maps being in the same asset?

    It may be worth building to Desktop with e.g. an Xbox gamepad to see if this is an issue specific to Switch, or a general difference between Build vs Editor. A separate, smaller project specifically for this may be easier to test.

  • The code that is now working is:
    playerInput.actions.FindActionMap(activeType.ToString()).Disable();
    playerInput.actions.FindActionMap(setActiveType.ToString()).Enable();
    playerInput is the UnityEngine.InputSystem.PlayerInput component

    Yes the switching also works inside non-AC scenes

    I only have one UnityEngine.InputSystem.PlayerInput component in the scene and all actionMaps are inside the referenced Actions Asset

    On Windows builds it is also working, so it could be an issue with the switch.
    You definetely helped with the switching of the action maps, thanks again! Maybe you still have ideas what I can try, but I guess I have to ask on the nintendo forum.

  • edited March 27

    Yes the switching also works inside non-AC scenes

    How about in Switch builds? We'll need to determine if AC is a factor here.

    I only have one UnityEngine.InputSystem.PlayerInput component in the scene and all actionMaps are inside the referenced Actions Asset

    Is that PlayerInput component the one attached to the integration's ContolsReader prefab?

    You definetely helped with the switching of the action maps, thanks again! Maybe you still have ideas what I can try, but I guess I have to ask on the nintendo forum.

    InputSystem does have a dedicated SwitchCurrentActionMap function, which may give better results. Otherwise, I'd say the Nintendo forum would be worth a visit.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.