Car behavior script interface
ICarBehaviorInstance interface derives from IBehaviorInstance to add APIs specific to the Car direction behavior.
Car behavior APIs
- Stop the movement, setting the speed to 0.
- Simulate one of the movement controls being held down. Useful when isDefaultControls is disabled. The control is provided as a string and must be one of
- Set or get the current speed in pixels per second. Note this cannot exceed
- Set or get the maximum speed in pixels per second.
- Set or get the acceleration/deceleration of the movement in pixels per second per second.
- Get the read-only X and Y components of the movement in pixels per second.
- The read-only current angle of the movement in radians.
- Set or get the rate the car rotates at when steering, in radians per second.
- Set or get the rate the car recovers from drifts, in radians per second. In other words, this is the rate the angle of motion catches up with the object angle. The angle of motion can never be more than 90 degrees off the object angle. If the drift recover is greater or equal to steerSpeed, no drifting ever occurs. The lower the drift recover, the more the car will drift on corners.
- Set or get the amount of speed lost when colliding with a solid, from 0 (stop dead) to 1 (speed not affected at all). For example, 0.5 will slow the speed down by half when colliding with a solid.
- A boolean indicating if the default controls (using the arrow keys) are enabled.
- A boolean indicating if input is currently being ignored. If input is ignored, pressing any of the control keys has no effect. However, unlike disabling the behavior, the object can continue to move.
- 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 Oct, 2019 at 16:05