Behavior

From Castle Wiki
Revision as of 20:39, 11 May 2022 by Ben (talk | contribs)

A Behavior is a component of a Blueprint which specifies how the blueprint's actors should behave. Common examples of behaviors include different types of physical movement, such as responding to Gravity, and interactive controls, such as dragging.

The most common way to add behaviors to blueprints is to open the Inspector, navigate to the Movement tab, and press Add physics or controls.

Another example of a behavior is Music, which can be added from the General tab of the Inspector.

Behavior properties

Many behaviors have adjustable properties. For example, the Gravity behavior has a property strength which governs how strong the force of gravity should be when it causes that blueprint's actors to fall. After you've added a behavior to a blueprint, you can edit the behavior properties in the inspector.

Changing a behavior with Rules

Most behaviors can be changed at play time using Rules:

  • The Modify a behavior property Response
  • The responses for enabling and disabling a behavior
  • The expression for the value of a behavior property