This Code Named Waypoint Progress tracker(Utility Scripts) is Showing errors

if (progressStyle == ProgressStyle.SmoothAlongRoute)
            {
                // determine the position we should currently be aiming for
                // (this is different to the current progress position, it is a certain amount ahead along the route)
                // we use lerp as a simple way of smoothing out the speed over time.
                if (Time.deltaTime > 0)
                {
                    speed = Mathf.Lerp(speed, (lastPosition - transform.position).magnitude/Time.deltaTime,
                                       Time.deltaTime);
                }
                   target.position = circuit.GetRoutePoint(progressDistance + lookAheadForTargetOffset + lookAheadForTargetFactor * speed)
                           .position;

                  target.rotation = Quaternion.LookRotation(circuit.GetRoutePoint(progressDistance + lookAheadForSpeedOffset + lookAheadForSpeedFactor * speed)
                               .direction);

Thats The Error Please help me.
The line it is heading to is target.position and target.rotation

Hi,

In which lecture are you? Which version of Unity do you use? And where did you get the asset from?

4_AA_CU2 SendMessage() Between Components

I use unity version 2017.3 0f 3.
I got it from standard assets

Remove the Circuit components from your game objects, rewatch the lecture again and assign the components again. Make sure everything is exactly as in the video.

Doesn’t work

In this case, please feel free to ask our helpful community of students for advice in our official Discord chat. I’m back on Monday or Tuesday.

If you are in a hurry, you could watch the two videos on the Circuit asset without implementing the circuit in your own project. Rick is going to replace it with a Timeline animation in a later video anyway.

Thanks

In the lecture where Ben introduces the waypoint tracker there’s an insert later on in the video where (I think - I’m going from memory) he addresses this.

If I remember rightly it was to do with

I think he changed the 0 to Mathf.Epsilon. It was something to do with doing a comparison between a float and 0, and how that’s not something you might want to do.

This might be it, or I might be getting mixed up with something else from memory.

If you search the Q&A on Udemy there were some more responses relating to this. I was having trouble too.

Thank you

How are you getting on with this, @Pritam95117C?


See also:

This topic was automatically closed after 14 days. New replies are no longer allowed.

Privacy & Terms