Enemy doesn't appear and follow path on play (solved)

I was having an issue where when I played the game, the enemies would instantly disappear instead of following the path. I tried adding debug logs to them following the index and when the object was destroyed, and found that it was only ever touching one waypoint, and then being deleted.

As it turns out, I had attached the else statement used to destroy the object onto the
if(transform.position == tragetPosition) statement, instead of the
if(waypointIndex < waypoints.Count) statement.

If you’re having a similar issue, I recommend starting by checking for that.

1 Like

This is not working for me
My enemies are staying on first Waypoint (0) and do not move

(solved)
I changed both Vectors to Vector3 and it works perfectly

3 Likes

thank you so much for sharing that.

Privacy & Terms