Move To behavior script interface
IMoveToBehaviorInstance interface derives from IBehaviorInstance to add APIs specific to the Move To behavior.
Move To behavior events
See behavior instance event for standard behavior instance event object properties.
- Fired when the object arrives at its destination.
- If Stop on solids is enabled, fired when the object hits a solid and stops.
Move To behavior APIs
- moveToPosition(x, y, isDirect = true)
- Start moving the object to a target position in layout co-ordinates. If
isDirect is true, any existing waypoints will be cleared so the object moves directly to this position; otherwise it will add a waypoint to the queue.
- Return the current target position in layout co-ordinates that the object is moving to. The
getTargetPosition() variant returns
- Return the number of waypoints that have been added.
- Return the position in layout co-ordinates of a waypoint at a given zero-based index. The
getWaypoint() variant returns
- Stop any current movement, and clear all waypoints.
- Read-only boolean indicating whether the object is currently moving.
- Set or get the current movement speed in pixels per second.
- Set or get the maximum movement speed in pixels per second.
- Set or get the acceleration and deceleration of the movement in pixels per second per second.
- Set or get the current angle the object is moving at, in radians.
- Set or get the rate the object can turn at, in radians per second.
- Set or get a boolean indicating whether the Stop on solids property is enabled. When enabled the object will stop its movement, clear all waypoints and fire the
"hitsolid" event if it touches an object with the Solid behavior during movement.
- A boolean indicating if the behavior is enabled. If disabled, the behavior no longer has any effect on the object.
Construct 3 Manual
You are here:
Search this manual:
This manual entry was last updated on 14 Dec, 2021 at 16:23