The Standard Input provides a full featured Input for Keyboard and Controller. It includes the ability to configure the input in-game and to load preferences from presets defined in a file.
How It Works
The Standard Input loads data from Player Prefs when it is initialised. If there is no data in the Player Prefs then the input will use the Default Controls defined for the GameObject.
Data To Load
The Data to Load configuration allows you to define a unique ID for the input. This ID will be used to load the data from Player Preferences when the input is initialised.
You can generally leave the default value unless you are creating a multi-player game in which case you should set a different ID for each player.
Remember: The default controls are only used if there is no data defined in the PlayerPrefs (i.e. when the player first loads up your game).
By expanding the Default Controls collapsible you can configure the default inputs which will be used if the player has not set any preferences
If Controller is enabled then the following axis will be used:
|Horizontal Axis||Left/Right axis used for moving back and forth.|
|Vertical Aix||Up/Down axis used for climbing ladders, crouching, etc.|
|Alt Horizontal Axis||An alternate horizontal axis which controls something other than movement (for example you could use it for aiming like in the Pixtroid Sample variation).|
|Alt Vertical Axis||An alternate vertical axis which controls something other than movement (for example you could use it for aiming like in the Pixtroid Sample variation).|
Other Axis Settings
Each axis has a number of other settings:
|Reverse Axis||Should the axis be reversed (i.e. does -1 equal right instead of left). Often set as part of in-game controller configuration.|
|Digital Threshold||At what point does the analog axis value set the digital value for the axis.|
All axis names follow the pattern:
So for example the first joystick left stick horizontal axis might be called:
Warning: These axis names must be configured in the Unity Input settings. If you correctly import Platformer PRO these axis should be automatically created.
Working with Input Data
There are several buttons which allow you to work with the Input Data:
|Load from File||Load input data from an input XML file and set them as defaults.. Several XML files are already defined with various input configurations.|
|Save to File||Save the currently configured defaults to an XML file.|
|Load from Preferences||Load the values currently set in PlayerPrefs and set them as the defaults.|
|Clear Preferences||Clear the Input Player Prefs.|
Note: The saved input data files can be used as presets that a user can load in-game.
See also: In-game Configuration of Input