Road TO Dev — Let’s create a special attack!

Rob Smith
3 min readJun 17, 2021

--

Objective: Create a homing missile that once fired will seek out the closest enemy and destroy it

Step 1: Create the powerup to activate the new special attack

Step 2: Create the method on the player for handling this new attack including setup variables to account for being true and give it an ammo count

Step 3: Create a check on player to see if there is an enemy before firing Setup same method for finding target on the missile once spawned so it can go to the closest target.

Step 4: Create the homing missile object to instantiate from the player including adding a box collider 2d for trigger, rigid body to control it’s angular movement, and a new tag for it to be identified by the enemy.

Step 5: Fire the missile if there is a target from player

Step 5: Make the missile go towards that enemy

Step 7: Create a death timer so the rocket doesn’t run forever if no target appears

Step 8: Tell the enemy it’s been hit by this new projectile and respond accordingly.

--

--

Rob Smith
Rob Smith

Written by Rob Smith

Hi there! I am currently on the path to learn how to become a unity developer and will be documenting my journey as best as I can here. Thanks for looking!

No responses yet