Gameplay Effect (GE)
Last updated
Last updated
GameplayEffects define how abilities change Attributes and GameplayTags. They cause immediate Attribute changes like damage or healing, or apply long-term status buffs/debuffs like a movespeed boost or stunning. GameplayEffects also can trigger GameplayCues.
Create a GameplayEffect ScriptableObject: 1. Right click in a folder on the editor -> Create -> GAS -> GameplayEffectSO 2. Select it, add modifiers and tags to describe the behaviour of the GE. (Use ADD MODIFIER button on the bottom of the GE SO) 3. Drag and drop it on a GA's effectSO list ATTENTION: To add the modifier, scroll down the GE scriptable object and click the "ADD MODIFIER WITH TYPE" button. Modifiers need to be instantiated with their type, otherwise they'll do nothing.
GameplayEffects have three types of duration: Instant, Duration, and Infinite.
Instant GameplayEffects make immediate permanent changes to attributes' base values. (e.g. Consume 5 mana points).
Duration and Infinite GameplayEffects make temporary changes to attributes' current values and apply gameplay tags that will be removed when the effect expires or is removed. (e.g. Increase MaxHealth for 30s, or Increase Strength while a sword is equipped (Infinite duration))
DurationValue defines how long the effect will last. This is ignored if durationType is Instant or Infinite. Period defines a periodic application. If period is bigger than zero (period > 0), the Modifiers will be applied every (period) seconds, while the GE is active (Duration or Infinite). Ignored if 0. (e.g. Health regen every period seconds)
Modifiers define which attribute will change and what operation is going to be applied to its value. Read more in the Modifier section.
These are references to the ASCs the effect has been applied with.
Define what GameplayCues will be triggered when the effect is applied. Check the GameplayCues Library folder to know which prefab is associated with which tag. Gameplay Cue
GrantedTags This is the most commonly used tag property. Tags that live on the GameplayEffect but are also given to the ASC that the GameplayEffect is applied to. They are removed from the ASC when the GameplayEffect is removed. This only works for Duration and Infinite GameplayEffects.
DescriptionTags Tags that describe the GameplayEffect. They do not do any function on their own and serve only the purpose of describing the GameplayEffect.
OngoingTagRequirementsRequired If any of these tags IS NOT present continuously, this GameplayEffect will be removed
OngoingTagRequirementsForbidden If any of these tags IS present continuously, the GameplayEffect will be removed. ApplicationTagRequirementsRequired If any of these tags IS NOT present, the GameplayEffect will not apply. ApplicationTagRequirementsForbidden If any of these tags IS present, the GameplayEffect will not apply.
RemoveGameplayEffectsWithTag GameplayEffects on the Target that have any of these tags in their Granted Tags will be removed from the Target when this GameplayEffect is successfully applied.