FPS Progression Report: Zombie Shooter (New Input System)Unity
The last project “Mobile Project Progression Report: Demo Finished Unity” was finished yesterday and much knowledge has been learnt.
Today I embark on an FPS Action project for the GameDevHQ program where the player will shoot some zombies. Who doesn’t like shooting mindless zombies.
Initial Setup
After setting up a simple plane and a cylinder representing the player, I added a Character Controller component to the player and a “PlayerController” C# script. Player movement will be controlled using the character controller following almost the same method used in previous projects (Tip of the Day: Character Controller in Unity)
New Input System
This time around, I will be using the New Input System instead of the old one.
After installing the new input system from the Package Manager and creating the asset in the Project Settings, I created Player Input Actions map in the assets folder.
The above map will allow the player to move using the WASP, jump using Space, and free look via mouse Delta/X and Delta/Y positions.
Next, a “Player Input” component was added, and the above map was added to the actions. I will be using “Invoke Unity Events” in order to visualize the controls.
As for the codes, each method will assign the registered input value to a variable controlling player movement, jump, and camera/player rotation(will get into more details in a later article).
Finally, I assigned each method to a unity even in the Player Input component, and now it is time for testing.