Commands for controlling the movement of the object along a path.
Properties
following |
Boolean value, which when true means the object is following a path. |
followAuto |
Set this value to true to use the automatic settings to follow the path. |
followAutoMoveSpeed |
A floating point value representing how fast to follow the path. |
followAutoTurnSpeed |
A floating point value representing how fast to turn along the path. |
followTolerance |
A floating point value that determines how close you need to be to a node in order to be classed as having arrived. |
currentTargetNode |
The current destination. |
Methods
removeAllNodes() |
Resets the path. |
addNode(pos) |
Adds the given point to the path. |
followBegin() |
Starts following the path. |
createViaWaypoints(targetPos) |
Creates the path via the waypoints in the scene. |
Examples
object.path.createViaWaypoints(objects.enemy.pos); // Find a route to the enemy
object.path.followBegin(); // Go!
Remarks
createViaWaypoints can be quite expensive in terms of performance, so it's a good idea to make sure it's not called every frame.
See Also


