Hey all,
I’m new to the Unity Input system, and I’m not sure I’m using the correct vocabulary to describe my question, so I’ve attached a GIF in addition to my description to try and better show what I want to do.
Essentially, I have multiple characters in my scene that the player can switch between. A handful of them (called “Scout” in my hierarchy) all share the same prefab and controls. Which “Scout” the player switches between is quite important to some of the puzzles and the primary gameplay loop. I’m using Invoke Unity Events as the Behavior property of the Player Input component. I find this method of using the Unity input system the easiest to understand. I also discovered that Unity seems to know which Scout the player switches to if I manually assign the methods to the Player Input via the inspector. Which is fine, but I plan to have upwards of dozens of different “Scouts” for the player to switch between. Which means every level and puzzle would become quite tedious having to manually assign them all in the inspector and could lead to some error on my part.
So I’m wondering: can I assign the GameObjects and their corresponding methods in the Player Input programmatically with code versus having to do it all in the inspector? I have included a GIF that I hope better shows what I’m going for.
wwar5nHqVjcsGbceIV