General Input
General input is for handling input that is not specific to a vehicle, such as game menu navigation, and can be placed anywhere in the scene.
To create your own general input script, create a new script that extends the General Input base class:
Initialization
When an input script is initialized, it means it has access to all the components it needs to control and is ready to run.
General Input scripts are initialized by default, but you can override the Initialize function in your own scripts to run your own checks before allowing it to initialize.
Input Update Conditions
If you want to run a General Input script only when certain conditions are met, you can add values to the Input Update Conditions list in the inspector. These are similar to Unity Events, and you can add boolean functions or getters from any script that must return True for the input to work.
Enable/Disable Input
You can enable or disable an input script at any time, or check if it is enabled:
Adding Your Input Code
To add your input code to a General Input script, you can override the Input Update function, which is only called when the input script is initialized and enabled and the input update conditions are met.
Last updated