As part of my time at Interactiva, we needed a flexible Character and Input system that would work cross-platform and account for a wide range of control schemes on each platform. For example, the projects based on a first and third-person controller had two control schemes: one with WASD + Mouse, and one with only the arrow keys. This was made to offer ease of use to users who weren’t accustomed to traditional controllers and game input. However, I had to account for this in the system’s design and code.
I also had to consider the use of multiple ‘Navigators’ which were simply logical “character controllers” that could ‘navigate’ the environment (notice the Navigators array above). This would allow easy swapping between controllers within the login with only one line of code, potentially letting the user switch to a third-person controller and a first-person controller dynamically.
The Navigator class formed the base of the hierarchy, letting each controller implement functionality for the same framework. Many of the projects I worked on at Interactiva required the controller to be disabled at times (for example, if the user focused on a mini-game or sub-activity). This was done using the methods that the Navigator class exposed.
Of course, I also had to capture the input from multiple devices. I did this using Unity’s new Input System package, which allowed capturing input from keys, controllers, and touch actions. This was handled in the Input System UI, which allowed the inclusion of multiple input sources. I captured this input via methods with CallbackContext arguments.