Road TO Dev — Boss Phase Two Movement

Objective: Create a 4 point system on screen to have the boss randomly move between in order to make it more difficult for the player to evade.

Step 1: Create an array variable and int for the index

Step 2: Setup the coordinates you want in the editor moving the boss around to see which ones you like

Step 3: Trigger the beginning of the second movement coroutine and stop the first

Step 4: Create the new routine allowing for random coordinates and use movetowards for a nice smooth motion

Tip: Ensure you are not triggering your movements by checking for the stage when you switch. Previously I had this setup to be constantly running the coroutine which made my boss warp between points erratically so if that happens to you I suggest checking this first!