Create a policy for moving an actor along a fixed path
Should the path repeat infinitely, or just run once?
The path on which to move
OptionalstartPoint?: numberThe point on the path from which to start
The speed at which the actor should move
OptionalwaypointCallback?: (which: number) => voidCode to run each time a waypoint of the path is reached, including the final one. It is given the index of that waypoint. On a looping path, the final waypoint is followed immediately by waypoint 0.
Is the movement paused right now?
The RigidBodyComponent to which this movement is attached
The RigidBodyComponent to which this movement is attached
Stop the actor where it is, and hold it there until resume() is called.
It's safe to call this from the waypointCallback, so that an actor can
stop when it reaches a waypoint.
Carry on toward the next waypoint, from wherever the actor is now. Does
nothing if the movement isn't paused. The waypointCallback is not run
again for the waypoint that the actor stopped at.
A rule for moving along a fixed path