Possible bug with StartPath callback


When clicking between two points (no matter if close or far, doesn’t depend on how fast i click i tried both slow and fast), my path gets cancelled (saw it through with logs as shown on the pic below).

I am quite sure i didn’t cancel it because i use StartPath on only one location and i checked the other locations on the code and they never triggered during this time. Can repeated calls to StartPath cause this behavior?

Below is the code that calls callback. It takes circa 10-70 tries to make this happen (and happens more often with multiple units as there is more chances).

            seeker.StartPath (transform.position, newPosition, OnPathComplete);

            void OnPathComplete (Path p)
                Debug.LogWarning("inside the callback");
                ...(rest of the movement code for unit)

If this is bug indeed is there some other way i can get path callback? Can i somehow see what triggered the cancelation? Is it possible that there is some desync that makes me cancel it with that one StartPath?

Clicking on the SAME spot after it failed (didn’t move mouse even a pixel) will send the unit there properly for the next click. I am really convinced there is a bug afoot seeing as it happened in the same frame in the picture and didn’t have any time to compute at all.


think i solved this one aswell :smiley:


This option was on and i guess if it hits the same frame or something it can produce the “feeling” of a bug as i mentioned above…

Tried it multiple times now and seems to work perfectly…

I mean it makes sense you just gotta know where to look for it :slight_smile:

1 Like