> For the complete documentation index, see [llms.txt](https://docs.anyrpg.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.anyrpg.org/scriptable-objects/abilities.md).

# Abilities

## Creation

To create an ability, find (or create) the *GameName/Resources/GameName/BaseAbility* folder (or any subfolder) in the project tab and right click.  Choose *Create > AnyRPG > Abilities > Ability*.

## Properties

All types abilities share a common set of properties, listed in the table below.

| Name                                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Require Out Of Combat                 | If true, the character must not be in combat to cast the ability.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Require Stealth                       | If true, the character must be in stealth mode to cast the ability.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Weapon Affinity Names                 | A list of [Weapon Skills](/scriptable-objects/weapon-skill.md).  The character must have a weapon equipped that matches the type of at least one of the skill to cast the ability.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Holdable Object List                  | <p>A list of <a href="/pages/eLtR6SVz1RG8X6hAuWNm">PrefabProfiles</a> that contain links to GameObjects that will be held while the ability is being cast.<br><strong>Holdable Object Name</strong><br>The name of a <a href="/pages/eLtR6SVz1RG8X6hAuWNm">PrefabProfile</a> that contains a link to a GameObject.<br><strong>Use Universal Attachment</strong><br>If true, attachment points from the <a href="/pages/eLtR6SVz1RG8X6hAuWNm">PrefabProfile</a> will be ignored, and the universal attachment in the <em>Attachment Name</em> field will be used.<br><strong>Attachment Name</strong><br>The <em>Node Name</em> field from one of the <em>Attachment Point Nodes</em> in an <a href="/pages/gl9O9NAYYwGSxo7t70iu">Attachment Profile</a>.</p> |
| Despawn Prefabs On Cast End           | If true, the prefabs will be despawned when the cast phase ends, instead of during or at the end of the action phase.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Ability Prefab Source                 | <p>An enumeration that defines what sources will be used for holdable objects.<br><strong>Both</strong><br>Holdable objects defined directly in the ability, and defined in the weapon will be spawned.<br><strong>Ability</strong><br>Only holdable objects defined in the ability will be spawned<br><strong>Weapon</strong><br>Only holdable objects defined in the weapon will be spawned.</p>                                                                                                                                                                                                                                                                                                                                                           |
| Animator Create Prefabs               | If true, holdable objects will be created in response to animation events, and not created automatically by the ability manager when the cast starts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Prefab Destroy Delay                  | The amount of time, in seconds, that holdable objects should persists past the end of the ability cast before being destroyed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Animation Profile Name                | The name of an [Animation Profile](/scriptable-objects/animation-profile.md) that contains a list of *Cast Clips* or *Attack Clips* (only for [Animated Abilties](broken://pages/eTwirBs9XjyLiHj0mjw4)) that will be performed while the ability is casting.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Use Unit Cast Animations              | If true, the ability will use the *Cast Clips* or *Attack Clips* currently active for the character, instead of the clips defined in the ability.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Is Auto Attack                        | Is this an auto attack ability.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Use Unit Attack Animations            | If true, a random animation from the unit attack animations will be used.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Use Auto Attack Animations            | This option is only valid if this is not an auto attack ability. If true, it will use the current auto-attack animations so it looks good with any weapon.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Use Weapon Hit Sound                  | If true, the current weapon default hit sound will be played when this ability hits an enemy.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| use Weapon Skill Attack Voice Setting | If true, the choice of whether or not to play the attack voice is controlled by the weapon skill.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Play Attack Voice                     | If true, the character will play their attack voice clip when this ability is used.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Animation Hit Audio Profile Name      | If the animation has *Hit* events while it is playing, this [Audio Profile](/scriptable-objects/audio-profile.md) will be played in response to those events.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Casting Audio Clip                    | An audio clip to play while the ability is casting.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Casting Audio Profile Name            | An [Audio Profile](/scriptable-objects/audio-profile.md) to play while the ability is casting.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Loop Audio                            | If true, the audio will be looped until the cast is complete.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Required Level                        | The level the character must be to learn the ability.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Character Class Requirements          | A list of [Character Classes](/scriptable-objects/character-class.md).  The character must be one of the classes to learn the ability.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Class Specialization Requirements     | A list of [Class Specializations](/scriptable-objects/class-specialization.md).  The character must be one of the specializations to learn the ability.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Useable Without Learning              | If true, the ability can be cast without learning it.  This is useful for teleport abilities that will be cast on interaction with a [Teleport Interactable Option](/scriptable-objects/interactable-option-configurations/teleport-config.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Auto Add To Bars                      | If true, when learned, the ability will be automatically added to the action bars in the UI if there is room.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Can Simultaneous Cast                 | If true, this ability can be cast while another ability cast is in progress.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Can Cast While Moving                 | If true, the ability can be cast while the character is in motion.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Ignore Global Cooldown                | This spell can be cast while the global cooldown is active.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Power Resource Name                   | The name of a [Power Resource](/scriptable-objects/power-resource.md) that will be spent to cast the ability.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Base Resource Cost                    | The base amount of the [Power Resource](/scriptable-objects/power-resource.md) that will be spent to cast the ability.  This amount is not scaled by level.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Resource Cost Per Level               | The amount of the [Power Resource](/scriptable-objects/power-resource.md) that will be spent to cast the ability.  This amount is multiplied by the character level.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Spend Delay                           | The time delay (in seconds) before the [Power Resource](/scriptable-objects/power-resource.md) is spent when the ability is cast.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Generate Power Resource Name          | The name of a [Power Resource](/scriptable-objects/power-resource.md) that should be gained when the ability hits the target.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Base Resource Gain                    | The base amount of the [Power Resource](/scriptable-objects/power-resource.md) that will be gained.  This amount is not scaled by level.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Resource Gain Per Level               | The amount of the [Power Resource](/scriptable-objects/power-resource.md) that will be gained.  This amount is multiplied by the character level.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Use Speed Multipliers                 | If true, after the cast time is calculated, it will be affected by the *Speed* secondary stat.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Use Animation Cast Time               | If true, the cast time is based on the length of the animation played while casting.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Ability Casting Time                  | If *Use Animation Cast Time* is false, this value will be used for the cast time.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Ability Cool Down                     | The cooldown time, in seconds, before the ability can be cast again.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Cool Down On Cast                     | If true, the cooldown will be initiated at the start of the cast, instead of the end of the cast, which is the default.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Use Ability Effect Targeting          | If true, the *Target Options* of the ability will be overridden by the *Target Options* of the first [Ability Effect](/scriptable-objects/ability-effects.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Ability Effect Target Stage           | If Ability Effect Targetting is used, the first ability effect from this stage will be used.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Target Options                        | A list of [Target Options](#undefined).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Tick Rate                             | This is the number of seconds between ticks, when [Channeled Ability Effects](/scriptable-objects/ability-effects/channeled-effect.md) will be cast while the ability is casting.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Channeled Ability Effect Names        | During casting, these ability effects will be triggered on every tick.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Cast End Ability Effect Names         | When casting is complete, these ability effects will be triggered.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Action Hit Ability Effect Names       | In response to Hit events during the animation, these ability effects will be triggered.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Action End Ability Effect names       | When the action is complete, these ability effects will be triggered.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

### Target Options

Target options control which targets will be considered valid targets for the purpose of determining if the ability can be cast on the target.

| Name                   | Description                                                                                                               |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| Require Target         | If true, the character must have a target selected.                                                                       |
| Require Line Of Sight  | The caster requires a clear line of sight to the target.                                                                  |
| Require Live Target    | The target must be alive.                                                                                                 |
| Require Dead Target    | The target must be dead.                                                                                                  |
| Can Cast On Self       | The ability can be cast on the caster.                                                                                    |
| Can Cast On Others     | The ability can be cast on targets other than the caster.                                                                 |
| Can Cast On Enemy      | The ability can be cast on targets the caster has a hostile [Faction](/scriptable-objects/faction.md) relationship with.  |
| Can Cast On Neutral    | The ability can be cast on targets the caster has a neutral [Faction](/scriptable-objects/faction.md) relationship with.  |
| Can Cast On Friendly   | The ability can be cast on targets the caster has a friendly [Faction](/scriptable-objects/faction.md) relationship with. |
| Auto Self Cast         | If true, and the caster does not have a target, the ability will automatically choose the caster as the target.           |
| Unit Type Restrictions | A list of valid [Unit Types](/scriptable-objects/unit-type.md) the ability can be cast on.                                |
| Use Melee Range        | If true, the ability can only be cast on a target when that target is in the casters hit box.                             |
| Max Range              | If *Use Melee Range* is false, the ability will have a maximum range of this value.                                       |
| Require Facing Target  | If true, the target must be in front of the caster.                                                                       |
| Max Angle              | The maximum angle to the left or right the target can be located at.                                                      |
| Require Behind Target  | If true, the caster must be behind the target.                                                                            |
| Require Ground Target  | If true, this ability will be cast on the ground, and not on a target.                                                    |
| Ground Target Color    | The color that will be used to tint the ground target casting circle.                                                     |
| Ground Target Radius   | The radius that will be used for displaying the ground target casting circle.                                             |

## Next steps

* Add an ability to the *Capabilities* of a [Character Class](/scriptable-objects/character-class.md).
* Add an ability to the *Capabilities* of a [Class Specialization](/scriptable-objects/class-specialization.md).
* Add an ability to the *Capabilities* of a [Unit Type](/scriptable-objects/unit-type.md).
* Add an ability to the *Capabilities* of a [Faction](/scriptable-objects/faction.md).
* Add an ability to the *Capabilities* of a [Unit Profile](/scriptable-objects/unit-profile.md).
