Using scripts to control 3D animations (new input system)
At present, new Unity 3D projects default to the old input system (this may change in later versions of the Unity Editor). However, many assets and projects now use the new input system, so let’s learn how to control our players using the new system. In this recipe, we’ll switch the project from the previous recipe to the new input system and then set up the input controls, event handlers, and scripts to work with the new input system.
Getting ready
This recipe is based on the previous one, so make a copy of that and work on that copy.
How to do it...
To use scripts to control animations with the new input system instead of the old Input.GetAxis(<>)
, perform the following steps:
- Open the Package Manager panel, by going to Window | Package Manager. Choose Unity Registry and locate the Input System package. Install this package.
- Open the Project Settings panel by choosing Edit...