Road TO Dev — Backwards firing enemy

Rob Smith
Jun 12, 2021

Objective: Have the enemy fire backwards when the player is behind it instead of firing forwards.

Step 1: Check position relative to player and setup logic to trigger reverse firing. Make sure to include the null check so when the player dies the enemy doesn’t keep trying to get it’s position.

Step 2: Create Reverse firing method and make a new method for firing forward. Note the new method call for Enemy Reverse in the for loop.

Step 3: Setup a bool in laser script to trigger the new method

Step 4: Create the method to handle this trigger

Step 5: Rework the laser update to handle the new trigger and set the laser to fire up when reversed

--

--

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!