How I fixed my enemy not moving on waypoints

12_ld_cud
laser-defender

#1

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.


#2

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.


#3

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.


#4

@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:


#5

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.


#6

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.


#7

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


#8

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


#9

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


#10

:smiley: :


#11

dude i love u and ur amazing


#12

I am happy to help!