IBehavior script interface

The IBehavior interface represents a kind of behavior, such as Solid, Physics or Pin. Some behaviors derive from this class to add extra options that are global to the entire behavior, such as the physics world properties in the Physics behavior. This interface is usually accessed through the IBehaviorInstance behavior property.

IBehavior APIs

getAllInstances()
Return an array of all instances that have this kind of behavior, for example every object with the Solid behavior. Note the returned instances may come from a range of different object types.
static getByConstructor(ctor)
Return an IBehavior from its constructor in the C3.Behaviors namespace, or null if it does not exist. For example IBehavior.getByConstructor(C3.Behaviors.Bullet) will return the IBehavior interface representing the Bullet behavior, or null if the behavior is not used in the project.
Construct 3 Manual 2024-06-24

On this page