Function IAstarAI.SearchPath

SearchPath ()

Recalculate the current path.

Public
void SearchPath ()

Recalculate the current path.

You can for example use this if you want very quick reaction times when you have changed the destination so that the agent does not have to wait until the next automatic path recalculation (see canSearch).

If there is an ongoing path calculation, it will be canceled, so make sure you leave time for the paths to get calculated before calling this function again. A canceled path will show up in the log with the message "Canceled by script" (see Seeker.CancelCurrentPathRequest).

If no destination has been set yet then nothing will be done.

Note

The path result may not become available until after a few frames. During the calculation time the pathPending property will return true.