Attribute

Definition

An Attribute is a Mono Behavior that holds a value.

Health, Posture, Mana, and Stamina are all examples of Attributes. Since Attributes can be influenced by Effects in an easy and stable way without tightly coupling your code, we encourage you to use Attributes for any values you want to change dynamically during gameplay.


Inspector

Attribute inspector

Resource Tag

The identifier for the Attribute. Effects and Use Attribute Mod use this to find their target Attribute.

Max Amount

The maximum value the Attribute can hold.

Min Amount

The minimum value the Attribute can hold.

Start Amount

The starting value of the Attribute.

Start Recover Speed

The rate at which the base value recovers or decreases. This can also be modified by an Effect.

Recover Mode

The method of recovery for the Attribute.

Can Recover

This should ideally be removed. The recommended way to disable recovery is by using an override Effect Mod Value to set the Recover Speed to 0.


Usage

To get the current value of an Effect, right-click on the component and select 'Log Value.' The value will be printed in the console. We plan to make this more visible in the future.

Manually fresh Attribute value

Attributes can be dynamically added to a character. Some special Attribute classes, like Health and Knockback, have different behaviors. However, we may change how Knockback is handled in the future.

Last updated