Adventures in Unity – Simple FPS

I took a bit of a break from programming my 2D engine to try out Unity.  This video shows my progress after about 12 hours with Unity.  Before setting out to do this, I had only spent a few hours messing around in Unity.  That being said, I was mostly following a tutorial, though I did branch out and do some things on my own.  Here’s a link to the tutorial that I used, which is very easy to follow other than the Blender bits at the beginning for setting up the level:

In this project, the player can fire using the left click.  This performs a raycast and creates a bullet hole texture on the first object hit.  If the object has health, this will do some damage to it.  There’s some code in there to keep it from colliding with certain objects, as well as a cooldown to regulate fire speed.  The right mouse button fires a slower moving thermal detonator that is affected by gravity.  Thermal detonators will light any enemy they touch on fire and deal tons of damage to enemies (In this project, it will destroy it in one hit).

The blue enemies have no death animation – They are simply destroyed.  When the red enemies die, however, they explode with fireworks particles.  You could imagine this being a death animation if I were using models/animations.

The project has a sky box, which looks great, but is very simple in Unity.  The project uses C# for scripting.  I didn’t show it, but the player can also jump.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: