Zombie Progression Report: Player Movement & Shooting Unity 3D

Mohamed Hijazi
Geek Culture
Published in
2 min readJun 28, 2021

Since the last progression report (FPS Progression Report: Zombie Shooter (New Input System)Unity), I finished working on player movement and added shooting to the game. Let’s start.

Player Movement

Firstly, I wanted to make it easier for the player to know where they were looking and aiming. So I added a reticle to the center of camera.

Reticle

After implementing the camera system, I found a bug where player movement is not being translated to global space, so player wasn’t rotating properly and I solved it by implementing one line of code (check the solution here: Local space vs world space in Unity). Also I found it essential to clamp the player vertical look, so they don’t look way down now way up.

Movement

Player Shooting

A shooting system in Unity can be done in so many ways, for our prototype for the GameDevHQ program, we decided to use Ray Casting. Basically ray casting is shooting a ray (an invisible laser) from a position to a destination and detecting if there was a collision between the ray and whatever it crosses paths with.

Ray Casting

Also, I added a global health system. One C# script that will be used by both the player and the enemies to create health and detect targets with the health components.

To test it out, I added the health script to two gameObjects, gave them some health, and started shooting.

Shooting

--

--

Mohamed Hijazi
Geek Culture

A knowledge seeking biologist who is following his passion into a full time career in Unity / Game Development. https://www.linkedin.com/in/mohamed-hijazi/