Modifying Attributes {{ currentPage ? currentPage.title : "" }}

Attribute Modifiers

Attribute Modifiers can be added to Gameplay Effects to modify values for the selected attribute. There are two types of modifiers, modifiers of addition or modifiers of multiplication. You can add a value to the selected stat, add a minus value to subtract a value, or you can multiply the base value. You DO NOT need to generate the modifier ID. The modifier ID can simply be left blank, the attributes system will automatically generate a modifier ID.

To add an attribute modifier to a gameplay effect, you need to create a new Gameplay Effect Class. From the details panel of the gameplay effect class expand the Modifiers section. Here you can add as many stat modifiers as you like.

To add an attribute modifier for an item so that an item can effect stats, you need to add them as a Gameplay Effect Class. For example, to add increased attack damage for a sword you need to create an attack gameplay effect and then add Attribute. Attack to the attribute modifiers. You can open the item data asset and add the gameplay effect there, when the weapon is equipped the gameplay effect will be applied & when the item is unequipped the gameplay effect will be removed.

Attribute Effects

Using the attribute modifiers system together with the gameplay effects system & inventory systems, this allows you to create various gameplay effects that modifies stats for each item. For example you could create a gameplay effect that generates health slowly over time & add that gameplay effect to an item such as a ring or talisman so that the effect is applied when the item is equipped.

Modifying Attribute Values at Runtime

In Addition to the Gameplay Effects system, there are other ways to modify attribute values at runtime. There are functions such as “Modify Current Attribute Value” and “Set Base Attribute Value” which allows for directly modifying & setting an attribute value at runtime without creating or using a gameplay effect class.

{{{ content }}}