I have one PlayerController component that controls the player using one Input Action Asset.
And some object controllers (Building, Power-ups, etc.) also use the PlayerController component. These share the same Input Action Asset but are different from the player. I am trying to make them reusable in other projects. That’s why I want to avoid using the same script for both controls even though they are the same player.
Scenario:
In the first scene, there is no player controller. Just these object controllers enable and disable each other. These work fine.
Example: Pressing “Enter” while the building’s PlayerController is active, disables the game object and enables its upgrade game object’s PlayerController.
In the second scene, the player gets close to the building, enabling the game object that holds the building’s PlayerController script. This time, the building’s PlayerController doesn’t work.
Note: I tried myPlayerInput.actions.Enable(); Not working. I must be missing something.
How do I make sure my input system always works with all devices automatically without taking exclusive control of the device as long as the game object holding the script is enabled? Regardless of what other stuff is going on in the scene.
The control isn’t complicated just horizontal, vertical axis input, Enter, and ESC key.
I am thinking using PlayerController may be a bad idea for my case and I need something custom. But I haven’t been able to find any tutorial about my use case. I have a very limited experience with the new input system.
Any link or suggestion would be really helpful. I don’t mind multiple hour-long tutorials or 50-page tutorials if it is useful. I am not smart but willing to work hard.
English is not my first language. I hope I was able to describe it properly. Please let me know if anything is unclear.