Creating the Drone Enemy


Author: Austin Anderson
Date: 11/9/23

Problems:
Creating the drone enemy presented many challenges. I realized that flying enemies is something that is particularly difficult. Most of the tutorials I found were flying enemies that just fly straight toward the player from where they are, however, I wanted my drone to use the nav-mesh, so that the drones can decide what they should do, rather than just flying straight to something. My next issue arose with particle effects. Whenever I would spawn the laser particle effects, they would not de-spawn. I tried destroying them after a certain amount of time, but it would only destroy the last one created. I then tried to save them into an array and destroy them that way but this, for some reason, worked the same way as the last solution I tried.


Solutions: 
The first problem was that I needed the drone to fly while still using the nav-mesh. I accomplished this by moving the capsule component, that the drone inherited, down below the drone as seen in the photo.

Now it appears that the drone is flying, when in reality it is just moved above the capsule component. It can now use the nav-mesh as if it was just a normal character on the ground. 

My next issue was the lasers not de-spawning as they should. The solution was to take a whole new approach. Instead of spawning in each of the particles one at a time, what I would do instead is give the drone a particle system component that is always there and just turn it visible and invisible. Since the drone already rotates toward its target, this ended up working flawlessly straight off the bat.

Get Cyber Siege

Leave a comment

Log in with itch.io to leave a comment.