Switching action maps new input system
Hi! I struggled a bit with wrapping my head around how to switch the current action map. I believe I have figured it out since when I print the current action map, it shows the one I want. However it also gives me those errors which I can't understand why is that. This is the function that switches the current action map
public void OnPauseGame(InputAction.CallbackContext ctx) { _playerController.paused = ctx.performed; _playerController.singletonManager.GameManager.PauseGame(); _playerController.singletonManager.UIManager.pauseMenu.SetActive(true); _playerController.singletonManager.GameManager.UnlockCursor(); _playerController.player.playerInput.SwitchCurrentActionMap("UI"); print(_playerController.player.playerInput.currentActionMap); }
and the errors that I get are
Error 1 stack trace - https://pastebin.com/5GYtHPXg (line 93 the line where I switch the maps in the code sample)
Error 2 stack trace - https://pastebin.com/iuLyMm6V
Error 3 stack trace - https://pastebin.com/Wz4cBJmR
If anyone could tell me why is that, that'd be brilliant! Thank you in advance.