Behavior
Ready-made game logic: put it in the part or model it acts on and tune its settings.
- Inherits: Instance
- Subclasses: Chaser, Checkpoint, Collectible, Door, Goal, Hazard, JumpPad, Leaderstat, MovingBehavior, RoundTimer, Spawner, SpeedPad, Teleporter, Trigger
- Creatable: No. The engine creates it.
- Replication: Replicated: clients get a copy, and changes the server makes reach them.
Ready-made game logic: put one inside the part or model it acts on (game-wide ones anywhere in the Workspace or ServerScriptService) and tune its settings. A behavior starts when it’s enabled and in the Workspace, reacts to setting changes at once, and stops cleanly when it’s removed or disabled, putting back what it changed.
Properties
Section titled “Properties”enabled
Section titled “enabled”Type: boolean · Default: true · Access: read/write · Replicates: yes
Runs while true. Turning it off stops it and puts back what it changed.
running
Section titled “running”Type: boolean · Access: read-only
True while it runs on this device (enabled, in the Workspace, and started by the game).
Inherited from Instance: name, archivable, id, className, parent, destroyed
Methods
Section titled “Methods”activate
Section titled “activate”activate(player?: Player | null): voidDoes what this behavior does when something sets it off: a Trigger, or a script. player is who set it off, when there is someone (a Door checks their stats, a Teleporter sends them). Does nothing while it isn’t running (one that was just added starts first). What it starts belongs to the behavior, not to the script that called it.
Inherited from Instance: getPropertyChangedSignal, setAttribute, getAttribute, getAttributes, getAttributeChangedSignal, getChildren, getDescendants, findFirstChild, findFirstChildOfClass, findFirstChildWhichIsA, findFirstAncestor, findFirstAncestorWhichIsA, waitForChild, isA, isDescendantOf, isAncestorOf, getFullName, clearAllChildren, destroy, clone, toString
Events
Section titled “Events”Inherited from Instance: changed, childAdded, childRemoved, descendantAdded, descendantRemoving, ancestryChanged, destroying, attributeChanged