Difference between revisions of "Behavior"

From Castle Wiki
(Created page with "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 m...")
 
Line 2: Line 2:


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'''.
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 ==
== 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 to fall. After you've added a behavior to a blueprint, you can edit the behavior properties in the inspector.
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 ==
== Changing a behavior with Rules ==
Most behaviors can be changed at play time using [[Rule|Rules]]:
Most behaviors can be changed at play time using [[Rule|Rules]]:


* The Modify a behavior property response
* The '''Modify a behavior property''' [[Response]]
* The responses for enabling and disabling a behavior
* The responses for '''enabling''' and '''disabling''' a behavior
* The [[expression]] for the value of a behavior property
* The [[expression]] for the value of a behavior property

Revision as of 20:39, 11 May 2022

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