Build a First-Person Shooter
Movement, camera, weapons, projectiles, enemy AI, and screen effects for an FPS prototype.
8 steps 9 scripts 2 kits intermediate
The path
Add these in order. Each step builds on the one before it.
- Start: 3D character controller with sprint and jump PlayerController3D.cs · First/third person character controller with smooth movement, jumping, and slope handling using CharacterController.
- Add first-person mouse look FirstPersonCamera.cs · First person mouse look camera with sensitivity, vertical clamp, and cursor lock. Plug into any FPS or exploration game.
- Create melee and ranged weapons WeaponSystem.cs · ScriptableObject-driven weapon system with melee and ranged attacks, cooldowns, ammo, and damage calculation.
- Add projectiles with damage and pooling Projectile.cs · Configurable projectile with speed, damage, lifetime, and optional homing. Integrates with Object Pool for zero-alloc shooting.
- Add health to player and enemies HealthSystem.cs · Reusable health component with damage, healing, invincibility frames, and events.
- Add impact feedback with camera shake CameraShake.cs · Perlin noise camera shake with magnitude, frequency, and duration. Trigger from explosions, impacts, or any event.
- Create enemies that detect and chase the player EnemyChaseAI.cs · Enemy AI that detects the player within radius, chases with line-of-sight, and returns to patrol when player escapes.
- Spawn enemy waves for combat encounters WaveSpawner.cs · Wave-based enemy spawner with configurable wave definitions, spawn points, delays, and wave completion callbacks.
Kits for this path
Every script in this path
- 3D Player ControllerFirst/third person character controller with smooth movement, jumping, and slope handling using CharacterController.
- First Person CameraFirst person mouse look camera with sensitivity, vertical clamp, and cursor lock. Plug into any FPS or exploration game.
- Weapon SystemScriptableObject-driven weapon system with melee and ranged attacks, cooldowns, ammo, and damage calculation.
- Projectile SystemConfigurable projectile with speed, damage, lifetime, and optional homing. Integrates with Object Pool for zero-alloc shooting.
- Health SystemReusable health component with damage, healing, invincibility frames, and events.
- Camera ShakePerlin noise camera shake with magnitude, frequency, and duration. Trigger from explosions, impacts, or any event.
- Enemy Chase AIEnemy AI that detects the player within radius, chases with line-of-sight, and returns to patrol when player escapes.
- Wave SpawnerWave-based enemy spawner with configurable wave definitions, spawn points, delays, and wave completion callbacks.
- Health Bar UIWorld-space or screen-space health bar with smooth fill, color gradient, and damage flash. Attach to enemies or use as HUD.