About Mathf.Epsilon correction on WaypointCircuit.cs

At time 0:45 of the video lecture, it is suggested to replace
if (Length == 0)

at line 64 of WaypointCircuit.cs with
if (Length <= Mathf.Epsilon)

But I don’t get how this is the same thing. As far as I can tell, if Length is -1 (or any number smaller than 0 - Mathf.Epsilon) the result will be true. Unity documentation suggests that we use instead
Length >= 0 - Mathf.Epsilon && Length <= 0 + Mathf.Epsilon

No one!? Jesus…

Another possibily of writing the same thing is Math.Abs(Lenght) <= Mathf.Epsilon

1 Like

I had to change it back to:

if (Length == 0)

I was getting errors from the waypoint progress tracker saying that the camera was an invalid target NaN

1 Like

I also had that issue, and it took me 1+ days of internet searches and thinking about what had changed . Very frustrating and I’m not sure why more people have not had this problem.

1 Like

Oh thank god I saw this. I got completely derailed with my waypoint script as well. Back to 0 we go

update: after making that fix back to “0”, no more “errors”, but now instead of that bug where upon start everything momentarily runs at hyper-speed before settling into normal speed, it stays at hyper-speed indefinitely. Its unfortunate to spend so much time troubleshooting a known proxy.

1 Like

Privacy & Terms