How I fixed my enemy not moving on waypoints

I did everything in the video, and my enemy didn’t move.

I output the transform.position to the log, and I noticed the Z axis was set to 5, and I’m not sure how that happened.

Once I updated the Z axis on all of my waypoint prefabs to 0 it moved as expected.

Hopefully this will help anyone else who encounters this issue.


Happened the same thing with me. Had to debug.log each and every step and found out that my Z was -2 for the Path(0) and the first waypoint was -2 . I wish I had seen your comment before i spent almost half an hour down the rabbit hole.

1 Like

i was stuck for 2 hours on this problem until i read this and never have felt more stupid.
That’s why he always says to reset when creating a new game object.

@Muneeb_Saeed, don’t feel stupid. I did reset my transforms, but somehow I still messed them up, and I couldn’t tell you how I did it.

If anything it’s a learning mistake, and I doubt you’ll make it again :wink:

Thanks a lot for the heads up. My enemy also didnt move after I followed all the steps, and it was driving me crazy. My Path’s Z-Axis was also not 0 and after I set it to 0 it started to move.

Just in case anyone has this same issue and their Z axis is just fine, make sure you moved all the waypoints AND enemy prefab onto the enemy waypoint section of the script. For some reason mine wasn’t attached, so the enemy only moved to the first waypoint and stopped.

I have changed the Vector2 to Vector3 and worked just brilliant!

1 Like

can u please explain what you mean by move the waypoints and enemy prefab?

Chris Semenov’s solution fixed my ship. It started to move again. Yey

:smiley: :

dude i love u and ur amazing

1 Like

I am happy to help!

Thank you! With this now I know why Rick always suggests to reset the game objects…