Function RVOController.SetTarget

SetTarget (Vector3 pos, float speed, float maxSpeed, Vector3 endOfPath)

Set the target point for the agent to move towards.

Public
void SetTarget (

Vector3

pos

Point in world space to move towards.

float

speed

Desired speed in world units per second.

float

maxSpeed

Maximum speed in world units per second. The agent will use this speed if it is necessary to avoid collisions with other agents. Should be at least as high as speed, but it is recommended to use a slightly higher value than speed (for example speed*1.2).

Vector3

endOfPath

Point in world space which is the agent's final desired destination on the navmesh. This is typically the end of the path the agent is following. May be set to (+inf,+inf,+inf) to mark the agent as not having a well defined end of path. If this is set, multiple agents with roughly the same end of path will crowd more naturally around this point. They will be able to realize that they cannot get closer if there are many agents trying to get closer to the same destination and then stop.

)

Set the target point for the agent to move towards.

Similar to the Move method but this is more flexible. It is also better to use near the end of the path as when using the Move method the agent does not know where to stop, so it may overshoot the target. When using this method the agent will not overshoot the target. The agent will assume that it will stop when it reaches the target so make sure that you don't place the point too close to the agent if you actually just want to move in a particular direction.

The target point is assumed to stay the same until something else is requested (as opposed to being reset every frame).

See

Also take a look at the documentation for IAgent.SetTarget which has a few more details.

Move