A small possible solution to the "hanging at start" duration bug

9:10
I’m not sure if this was fixed later on in the course, I am only halfway through this project now, but on the refactoring portion I wanted to try to fix this issue. As he stated it hangs there due to trying to travel essentially from the start position to the start position inside the “moveToPosition” method. A solution I implemented was just skipping the first item in the list before using the “followPath” loop since we only need to travel from the second waypoint onwards.

private IEnumerator FollowPath()
{
       foreach(Waypoint waypoint in _path.Skip(1)) //Uses LINQ to return a list with the first item removed
///

I’m having a fun time with this project, and I wanted to give a possible solution incase others were trying to fix this “bug” as well.

Privacy & Terms