I am making a Co-op game and looking at implementing full controller remapping with the new unity input system. In order to do this I am cloning the input action asset with Instantiate() so that each player can have there own controls.
I then have to assign this new copy to the PlayerInput, which is working fine for me and also the InputSystemUIModule, which is where my problem is.
Currently, when I assign the new clone to the ActionAsset field, it resets all of the bindings. (Point, Left Click, Move ect). To work around this I get the InputActionReferences to the actions I want to re-assign and then set the field to the InputActionReference.
However, rather than correctly set it, it just remains as none. I get no errors or debug messages, and I am fairly sure that the InputActionReference I have is correct. The only other information I have is that when attempting to set the values’ through the inspector, the only value available is none.
Here is the code I am using:
newInputAsset = Instantiate(inputAsset); InputAction moveAction = inputActionAsset.FindActionMap("Player").FindAction("Menu Move"); InputSystemUIModule uiInputModule = GetComponentInChildren<InputSystemUIModule>(); uiInputModule.move = InputActionReference.Create(moveAction);
Does anyone know how I might solve this problem, or circumvent it somehow? Any help much appreciated.
I’m on unity Version 2020.3 and input system version 1.1!