OnActorArrive
An actor reached its MoveActor target.
It stands there until the next MoveActor. Chain the legs of a route here.
Syntax
Section titled “Syntax”function OnActorArrive(id) -- ...end| Parameter | Type | |
|---|---|---|
id |
number | the actor |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”-- a patrol between two points, for everlocal route, leg = {{1280, 1100, -1}, {1300, 1100, -1}}, {}
function OnActorArrive(id) leg[id] = (leg[id] or 1) % #route + 1 local p = route[leg[id]] MoveActor(id, p[1], p[2], p[3], 1.5)endSee also
Section titled “See also”MoveActor · StopActor · IsActorMoving · the NPC actors group of the index
