Adding Hostile Enemies


Welcome Back!

In my last devlog, I was rebuilding my project after it got corrupted. In this devlog, we're going to be adding hostile enemies! (Yes, I've been using dummies until now). 

Setting Up

To start off, I planned what I should do for my enemies. I decided to add detection zones. Basically, if you entered a detection zone, any enemies assigned to that detection zone would start firing at you. This allowed for easy customization.

Implementing Enemy Looking and Shooting

I first programmed a script to make the enemy look at the player, which did not work. After debugging for a solid 30 minutes, I realized I just assigned the wrong object.  I then gave the enemy a gun, made a sick bullet trail, programmed firing, and watched as it all crashed and burned.

Debug Time!

My first mistake was that I assigned the script to the trail, and not the actual bullet. Secondly, I did not rotate the bullet mesh to go head first. After I fixed these errors, I moved on to detection zones.

Detection Zones

Making detection zones was pretty easy. All I had to do was give an object a collider, and create a simple script. I did that, and after wondering why it wasn't working for a full hour, I realized I forgot to tell the zone what the player was.

After a full day of suffering, I finally implemented hostile enemies! Go check out the video above to see it in action. See you in the next devlog!

Get Hack FPS

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.