FPS Foundation Kit
First-person shooter foundation with movement, camera, weapons, projectiles, health, and screen shake.
6 scripts intermediate Starter kit Great for FPS prototyping
Download fps-foundation-kit.zip 6 scripts and a README · 17 KB of C# · MIT
What is inside
- PlayerController3D.cs First/third person character controller with smooth movement, jumping, and slope handling using CharacterController.
- FirstPersonCamera.cs First person mouse look camera with sensitivity, vertical clamp, and cursor lock. Plug into any FPS or exploration game.
- WeaponSystem.cs ScriptableObject-driven weapon system with melee and ranged attacks, cooldowns, ammo, and damage calculation.
- Projectile.cs Configurable projectile with speed, damage, lifetime, and optional homing. Integrates with Object Pool for zero-alloc shooting.
- HealthSystem.cs Reusable health component with damage, healing, invincibility frames, and events.
- CameraShake.cs Perlin noise camera shake with magnitude, frequency, and duration. Trigger from explosions, impacts, or any event.
What it does
- 3D character controller with sprint, jump, and slope handling
- First person mouse look with sensitivity and vertical clamp
- ScriptableObject weapon system (melee and ranged)
- Pooled projectiles with damage, homing, and impact VFX
- Health system with invincibility and event callbacks
- Perlin noise camera shake for impacts and weapon fire
Setup, in order
- Import all scripts into your project
- Create Player with CharacterController component
- Attach PlayerController3D to the player
- Add Camera as child, attach FirstPersonCamera
- Create WeaponData ScriptableObjects for your weapons
- Attach WeaponSystem to player, assign attack point
- Create projectile prefab with Projectile and trigger collider
- Add CameraShake to camera, trigger from weapons
If something does not work
- The mouse does not turn the view
- FirstPersonCamera locks the cursor on start and pauses look while the cursor is unlocked; Escape unlocks it. Click inside the Game view to lock it again. Also check that the camera is a child of the player and that the player body is assigned.
- The player cannot jump or falls slowly
- PlayerController3D checks the ground with
Physics.CheckSphereat its ground check point against Ground Mask. Put the point at the feet and select your floor's layer in Ground Mask. - Projectiles pass through targets
- Projectile reacts in OnTriggerEnter, so its collider must be a trigger and either it or the target needs a Rigidbody. Check that the Hit Layers mask includes the target's layer.
- The Weapon Data menu is missing
- Weapon assets are created from Assets > Create > Weapons > Weapon Data. If the menu is missing, a compile error is stopping the scripts from loading; fix the Console errors first.
- Every input call throws InvalidOperationException in a new Unity 6 project
- The scripts read the legacy Input class, which new Unity 6 projects switch off. Set Project Settings > Player > Active Input Handling to Both and let the Editor restart. Details and the Input System alternative.
Preview
An excerpt of the kit's main types, and the Inspector fields they expose.
Inspector
Fields from the kit's preview excerpt; the full kit has more.
Weapon Name
Is Melee
Damage 10
Attack Rate 1
Projectile Prefab None (GameObject)
Current Weapon None (WeaponData)
Excerpt
C#
// WeaponData.cs - ScriptableObject weapon definition
[CreateAssetMenu(menuName = "Weapons/Weapon Data")]
public class WeaponData : ScriptableObject
{
public string weaponName;
public bool isMelee;
public float damage = 10f;
public float attackRate = 1f;
public GameObject projectilePrefab;
}
// WeaponSystem.cs - Attack controller
public class WeaponSystem : MonoBehaviour
{
[SerializeField] private WeaponData currentWeapon;
public void Attack() { /* melee or ranged */ }
public void EquipWeapon(WeaponData weapon) { /* swap */ }
}Related
- Enemy AI KitComplete enemy AI pipeline: state machine, patrol, chase, health, and wave spawning with debug visualization.
- 2D Platformer Starter KitComplete 2D platformer foundation with movement, camera, advanced mechanics, health, collectibles, and transitions.
- Build a First-Person ShooterMovement, camera, weapons, projectiles, enemy AI, and screen effects for an FPS prototype.