Road TO Dev — Enemy closing in!

Rob Smith
Jun 14, 2021

--

Objective: Make the enemy move towards the player when within a certain range.

Step 1: Create the variables for toggling this movement mode on and setting the max distance from our player to begin. In order to make it easier changing this distance Serialize it.

Step 2: Setup the code to check the distance to the player and enable moving towards if close enough

Step 3: Create the code for moving towards the player’s position once this is toggled on.

Step 4: Make sure to include this new check in the other movement sections in order to avoid conflicts.

--

--

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