Bug Blasting
This is my 3D First Person Shooter game assignment for Michigan State University's CAS 117 Games and Interactivity class. It was rated one of the Top Three 3D FPS assignments by the professor, and was shown at the Spring 2025 Student Showcase.
CONTROLS:
Keyboard and Mouse:
Move: WASD, arrow keys
Aim: Mouse
Jump: Space
Shoot: Left-click
Cycle Weapons: 1 or 2, Mouse Wheel
Pause: Esc
Gamepad:
Move: Left Stick
Aim: Right Stick
Jump: X
Shoot: R2
Cycle Weapons: L1 or R1
Pause: Start
The class provided Unity prefabs for the player and animated bugs, and a number of C# scripts for the game manager, player, enemy, health, projectile, and damage scripts. After completing a tutorial to get a basic 3D FPS game working, I made a lot of modifications:
Designed a level based on a three-story house using 3d assets from Kubikos Sci-fi Cube World. Set up lighting in all rooms, including realtime lights, baked GI, light probes, and reflection probes, and added post-processing bloom and vignette.
Added Mosquito ("Screecher") enemies and fixed some issues with the state machine animation transition timing so it smoothly blends into different animations.
Created a UML model of the Enemy, GroundEnemy, FlyingEnemy, and EnemyAttacker classes using Visual Paradigm to better understand them. Refactored a lot of the enemy code, renamed functions and variables, and adjusted comments to conform with standards we learned in CSE 335 Object-Oriented Software Design. Removed redundant booleans isIdle, isAttacking, isMoving and stored state in ActionState only, which helped me fix a state machine bug with Screecher attack animation not playing every time.
Projectiles: Fixed problem where fast projectiles would "tunnel" through walls and enemies by adding a Physics.RayCast check in Projectile.Update(). Fixed a bug where projectiles were causing multiple destruction effects (the electrogun projectile was causing multiple mini-missile explosions on impact). Added an Environment layer check in the damage script so that environment assets don’t need to have a health component to stop projectiles. Used a green icicle for the enemy projectile, and added a destructible effect when it hits the wall
Fixed a bug where the Larvae (ground shooter) continues moving while attacking (sliding on the floor).
Removed the RigidBody from the FPSPLayer and the code that interacts with it in PlayerController.cs, because it's not needed when using a CharacterController.
Removed PlayerController.OnDisable because it's not needed (inputs already get disabled when player death disables PlayerController.)
Increased gravity so player doesn't float in the air so long.
Added animation when swapping guns, the current gun rotates down offscreen and the new one rotates up into place. Prevented weapon swapping until player gets at least 2 different guns.
When flying enemies detect player, they rotate toward player in a fraction of a second, instead of instantly rotating.
Fixed a bug where scrolling the scroll wheel can change weapons way too fast (60 times per second.)
Fixed a bug where holding down the trigger button halfway on PS5 controller with the ElectroGun fires way too many of them too fast.
Fixed a bug with gamepad left stick not working in WebGL.
Bug fix: player respawn resets rotation and camera angle as well as position.
Made enemy rigidbodies kinematic when idle, to fix a problem where they would slowly wander in random directions.
Fixed a bug where the pistol was shooting at the wrong angle if the player dies or switches weapons during the shooting animation.
Added separate internal scaling factors for mouse and gamepad look sensitivity to fix problem where mouse moved too fast compared to gamepad. Reduced WebGL mouse sensitivity to a quarter of what it is for Mac/PC.
Adjusted bug and giblet materials to be shinier.
Increased the amount of giblets, and the force applied to them, when enemies die.
Disabled double jumping.
Changed WebGL Quality from Balanced to High Fidelity for full lighting quality.
Fixed a bug: when you die, it was playing both the PlayerHurtEffect and the PlayerDeathEffect, and it sounded like 2 different people moaning at the same time, so I removed the HurtEffect when you die.
Sound: replaced many of the sound effects with new ones from Forge3D Sci-Fi Sounds. Added new sound effects for: weapon swap (each weapon has its own swap sound effect), shotgun fire, impact, and shotgun icicle and icicleparticle impacts, ExtraLife pickups.
Added buzzing sounds for flying enemies, and replaced the music with a creepy sound loop.
Added the shotgun and electrogun pickups you acquire in the level.
Smoothed the normals of the enemy bugs so they are not so faceted, by setting Import Settings - Model - Normals - Calculate.
Changed Enemy.HasLineOfSight to send the raycast from the enemy eyes (instead of enemy root) to fix a bug where the player can see the enemy but the enemy couldn't see the player, and used Debug.DrawLine to draw lines in the editor to troubleshoot this.
Added joystick rumble when getting hurt.
Added recoil movement and muzzle light to the shotgun blast.
UI: changed the font, added Controls and Credits pages.
Fixed a bug where shooting with the pistol and then cycling back to it would play the sound effect a second time.
Credits
-----------
Tutorial project with basic gameplay scripts, weapons, and animated bugs:
MSU CAS 117
Game design and development:
Bob Wilson
Sound Effects:
Forge3D Sci-Fi Sounds
3D assets:
Kubikos Sci-fi Cube World
Font:
Orbitron from Google Fonts
Updated | 15 days ago |
Status | In development |
Platforms | HTML5, Windows, macOS |
Author | Bob Wilson |
Genre | Shooter |
Made with | Unity |
Install instructions
You can play this game right in the web browser on a computer (not on a phone), it is not necessary to download the Mac or Windows files. But you will probably get a better framerate with the Mac or Windows versions than the web browser version.