GASify
  • Introduction
  • Overview
  • Installation
  • Basic Usage
  • Ability System Component (ASC)
    • Attributes
    • Attribute Processors
    • Targetting System
  • Gameplay Ability (GA)
    • Gameplay Ability Implementations
    • Creating New Abilities
  • Gameplay Effect (GE)
    • Modifier
    • Calculation (GEC)
    • Behaviour (GEB)
  • Gameplay Tag
  • Gameplay Cue
  • Data Groups
  • Cookbook 🥣
  • Multiplayer / Networking
  • Contact & Note
Powered by GitBook
On this page
  1. Gameplay Ability (GA)

Creating New Abilities

To create new ability types, just inherit from the base GameplayAbility class.

Instantiate: Creates a new GA instance, this is used to get copy the ability data from a ScriptableObject into a runtime version of the ability. Anything that need to be copied from the original SO when the ability is granted, should be done here.

An Ability has 3 activation steps: PreActivate, Activate, PostActivate.

PreActivate sets initial data (isActive, source/target, etc...) Activate applies cost/cooldown. This is what you should generally override for your ability. (e.g. InstantAbility overrides this, calls base.Activate() and ApplyEffects and deactivates immediately). PostActivate the ability has completely activated.

CanActivate and CheckCost can also be overriden for custom behavior (e.g. ShootAbility - Check ammo cost on inventory)

ScriptableObject

Also, create an ScriptableObject container to be able to create its asset. e.g.:

namespace GAS {
    [CreateAssetMenu(menuName = "GAS/GameplayAbilitySO_InstantAbility", fileName = "GA_InstantAbility")]
    [Serializable]
    public class GameplayAbilitySO_InstantAbility : GameplayAbilitySO {
        public GameplayAbilitySO_InstantAbility() {
            ga = new InstantAbility();
        }
    }
}
PreviousGameplay Ability ImplementationsNextGameplay Effect (GE)

Last updated 1 year ago