Scene Path
The scene path is the path through the levels of your game. It is created using the start and end points on each level. To access your game’s Path object, use this.scene().path().
Function | Description |
---|---|
anchorAtPosition(value) |
Returns the anchor position and rotation at the given path position. |
anchorPosition() |
Returns the current anchor position of the path. |
anchorRotationQuat() |
Returns the current anchor rotation of the path in quaternion. |
pathPosition() |
Returns the current path position. The path position is simply how far along the path the game has moved. |
pathSize() |
Returns the path size. |
pathTangent() |
Returns the current path tangent. |
positionOnPath(entity) |
Takes an entity or 3D world position and returns the position along the game path. |
setAutoPositionUpdate(value) |
Enables/disables auto path update. If it is disabled, levels will not be created automatically along the game path. |
setPathPosition(value) |
Sets the current path position. |
anchorAtPosition(value)
Returns the anchor position and rotation at the given path position.
Parameters
number value – the path position
Returns
Vec3 the {x, y, z} anchor position of the path at the given position
anchorPosition()
Returns the current anchor position of the path.
Returns
Vec3 the {x, y, z} anchor position of the path
anchorRotationQuat()
Returns the current anchor rotation of the path in quaternion.
Returns
quaternion the anchor rotation of the path
pathPosition()
Returns the current path position. The path position is simply how far along the path the game has moved.
Returns
number the current position along the path
pathSize()
Returns the path size.
Returns
Vec2 the {x, y} path size
pathTangent()
Returns the current path tangent.
Returns
Vec3 the {x, y, z} current path tangent
positionOnPath(entity)
Takes an entity or 3D world position and returns the position along the game path.
Parameters
Entity entity – the entity to find the game path position of or Vec3 pos a 3D world position
Returns
number the position on the game path of the given entity or 3D world position
setAutoPositionUpdate(value)
Enables/disables auto path update. If it is disabled, levels will not be created automatically along the game path.
Parameters
boolean value – true to enable auto position update, false to disable
setPathPosition(value)
Sets the current path position.
Parameters
number value – the new path position