Function AIBase.Teleport

Teleport (Vector3 newPosition, bool clearPath=true)

Instantly move the agent to a new position.

Public
void Teleport (

Vector3

newPosition

bool

clearPath=true

)

Instantly move the agent to a new position.

This will trigger a path recalculation (if clearPath is true, which is the default) so if you want to teleport the agent and change its destination it is recommended that you set the destination before calling this method.

The current path will be cleared by default.

This method is preferred for long distance teleports. If you only move the agent a very small distance (so that it is reasonable that it can keep its current path), then setting the position property is preferred. When using the FollowerEntity movement script, setting the position property when using a long distance teleport could cause the agent to fail to move the full distance, as it can get blocked by the navmesh.

See

Works similarly to Unity's NavmeshAgent.Warp.

SearchPath