Behavior() function

Warning: This API is now obsolete.

use ScriptBehavior instead https://docs.oncyber.io/behaviors (opens in a new tab)

Defines a script as a behavior that can be attached to components in the world to add functionality You can use Behaviors to add a variety of functionality to components like adding Examples include:

  • Animating a component - Make the component follow the player - Attack the player when they get close

You can annotate the script class properties using @Param to make them editable in the studio

Signature:

export declare function Behavior(options: BehaviorOptions): ClassDecorator;

Parameters

Parameter

Type

Description

options

BehaviorOptions

**Returns:**

ClassDecorator