Custom FPS System developed in Unity, using the Standard Render Pipeline.
The System uses five main C# scripts to implement the FPS System.
- PlayerMovement.cs
- FpsControllerLPFP.cs
- AutomaticGunScriptLPFP.cs
- Weapon.cs
- WeaponHandler.cs
To have a quick look at the above scripts, you can view the contents of the folder called 'Scipt Files - Quick View'.
-
Level-1: The root-component "FPS Player":
Must consist of Rigidbody, Character Controller, and the custom FpsControllerLPFP.cs script.Level-2: Under the "FPS Player" game object:
The Player-UI and HUD can be placed here. Place an empty game object as the "Main Rig" (you can call it anything you like).Level-3: Under the "Main Rig" game object:
Place an empty game object as the "Weapons Rig" (you can call it anything you like).Level-4: Under the "Weapons Rig" game object:
This level consist of the Gun-Camera, and another empty game object called "Weapons".Level-5: Under the "Weapons" game object:
This level contains all of the weapon prefabs that the player may possess in the game. The "Weapons" game object must have the WeaponHandler.cs component attached to it. The weapons that shall be placed under this game object must contain the Weapon.cs component attached to them, to mark them as a weapon.Each weapon under the "Weapons" game object contains the AutomaticGunScriptLPFP.cs component attached to it, if the weapon happens to be a gun.
The game uses standard first-person shooter contols such as
- WASD for Movement
- Mouse to Look Around
- Spacebar to Jump, and
- LeftShift to Sprint
Siddharth M
MIT Manipal, India