Search Unity

Activating/deactivating action maps at runtime?

Discussion in 'Input System' started by LordMortis, May 7, 2016.

  1. LordMortis

    LordMortis

    Joined:
    Jan 25, 2014
    Posts:
    27
    Is this in?

    I currently have a 'global action map' that contains keys to switch between different control types:
    1. rotate camera
    2. rotate what you're looking at
    3. move what you're looking at
    but when i change the ActionMapSlot that's on the PlayerInput instance to active it doesn't seem to actually work (i've tested this by setting it at startup and it works fine)

    What am I missing?
     
  2. LordMortis

    LordMortis

    Joined:
    Jan 25, 2014
    Posts:
    27
    Okay, nevermind - this does work but here's how it works:

    on the PlayerInput instance you have a list of ActionMapSlots for your actual action maps, but when that PlayerInput instance boots up it has a PlayerHandle instance which containst the actual ActionMapInput(s) that need to be active. So if you need to change things at run time - don't worry about the ActionMapSlots, do it on the ActionMapInputs :D
     
    runevision likes this.