-
in this lesson, lesson 100, enemies who follow path 0 in the video lesson… move following reverse order? They go from waypoint 2 then to 1 then to 0, while enemies who follow path 1 go in correct expected regular order 0-x
-
I have tried changing the paths and waypoints’s position a bunch of times and… regardless of how I move path and waypoints, path 0 enemies always spawn from one certain place and path 2 enemies always spawn from another place, and they move mimicking the waypoints, but with position offset due to them not spawning at the starting waypoint.
So I have added a couple of Debug.Log to my code in EnemyPathing.cs
void Start() {
Debug.Log("beginning 1 : " + transform.position);
waypoints = waveConfig.GetWaypoints();
transform.position = waypoints[waypointIndex].transform.position;
Debug.Log("beginning 2 after transform.position = waypoints[waypointIndex].transform.position; : " + transform.position);}
and the result was that it does… absolutely nothing. transform.position prints the same coordinates before and after the assignment. I can comment it out and it runs with no difference.
Digging deeper I’ve realized that the problem once again was that I had updated to one of the more recent Unity versions with the prefab access change, and while the trick suggested by others for adding waypoints to path (all at once before putting them into path) did the trick for that problem, now moving around paths (position in space) present as objects in the editor and on the screen is not considered a change by override system - so to change a path position you have to open the prefab and change it from there without any point of reference such as the background and player spaceship position.
I’m leaving this written for reference for others who may end up with the same problem… so… DON’T upgrade to Unity 2018.3+ !
Being unable to check prefab values by clicking on them on the editor, being forced to open them every time is enough of a pain, but to compound them with every other problem is a major pain.
As to why the transform assignment is unnecessary, I have no clue.