New Ability
Create a custom Ability for behavior that must participate in UCC input, priority, movement, State, equipment, or Animator lifetime. Prefer an included ability when it already fits. Keep project scripts outside the package; an assembly definition must reference Opsive.UltimateCharacterController.
Create an input-driven ability
Create Crawl.cs in a project script folder. This minimal version uses a held input, activates the Crawl State, and supplies Animator index 101:
using Opsive.UltimateCharacterController.Character.Abilities;
[DefaultInputName("Crawl")]
[DefaultStartType(AbilityStartType.ButtonDown)]
[DefaultStopType(AbilityStopType.ButtonUp)]
[DefaultAbilityIndex(101)]
[DefaultState("Crawl")]
[System.Serializable]
public class Crawl : Ability
{
}
After compilation, add Crawl under Ultimate Character Locomotion > Abilities and confirm:
| Setting | Minimal example |
|---|---|
| Start Type / Stop Type | Button Down / Button Up |
| Input Names | Crawl, mapped by the character’s input integration |
| State | Crawl |
| Ability Index Parameter | 101, matching the intended Animator branch |
Default attributes apply when an entry is created. After changing attributes, update an existing serialized entry explicitly or remove/re-add it. Do not keep duplicate Crawl entries accidentally. Place critical interruptions above Crawl.
The empty class uses the base lifecycle. Add overrides only for behavior it must perform itself.
Choose lifecycle and locomotion ownership
| Use case | Start/stop choice |
|---|---|
| Hold | Button Down / Button Up with the same input name. |
| Toggle | Button Down / Button Toggle. |
| Environmental condition | Automatic start with meaningful CanStartAbility() checks; select an appropriate stop type and CanStopAbility(bool) gate. |
| Another system owns activation | Manual, using locomotion start/stop requests. Manual does not poll Input Names. |
| Reusable custom rule | Custom with a Starter or Stopper. |
Automatic start repeatedly evaluates its gate. A gate that always permits activation starts wherever the other constraints allow it. Nonconcurrent list order sets priority; concurrency and IgnorePriority/conflict overrides should express deliberate combinations.
State activates a State System preset during the ability. Ability Index Parameter selects an Animator branch; use -1 for no dedicated branch. AbilityChange is raised when the Animator’s index changes. Use integer/float data and Moving for additional transition conditions. State names, Animator indices, and object IDs have separate consumers.
In General, disable unwanted positional/rotational input. Retain No Override for gravity/collision features unless the behavior must force or suppress them. For root motion, retain character policy with No Override on both channels, enable the required channel with True, or use False on both to suppress both together. Test values during activation and after normal/interrupted stopping.
For item restrictions, configure Allow Equipped Items, add Item Equip Verifier, and retain the normal Equip Unequip ability. Reequip Slots restores previous items after stopping.
Worked example: trigger-owned tunnel crawl
This alternative replaces the minimal Crawl class. It uses object detection, item restrictions, limited turning, and full-body animation.
Prepare the tunnel and replace the class
Create a trigger covering the complete crawl area. Include its layer in Detect Layers and add Object Identifier on the trigger or a parent with ID: 101.


Replace the class with this DetectObjectAbilityBase implementation. It starts automatically for a valid trigger, limits requested rotation per update, blocks item abilities, and stops after the final valid trigger is exited:
using UnityEngine;
using Opsive.UltimateCharacterController.Character.Abilities;
using Opsive.UltimateCharacterController.Character.Abilities.Items;
[DefaultStartType(AbilityStartType.Automatic)]
[DefaultStopType(AbilityStopType.Manual)]
[DefaultObjectDetection(ObjectDetectionMode.Trigger)]
[DefaultAbilityIndex(101)]
[DefaultState("Crawl")]
[DefaultEquippedSlots(0)]
[DefaultReequipSlots(true)]
[System.Serializable]
public class Crawl : DetectObjectAbilityBase
{
[Tooltip("The maximum number of degrees the character can rotate per update.")]
[SerializeField] private float m_MaxRotationAngle = 0.5f;
public override void ApplyRotation()
{
base.ApplyRotation();
var angle = Quaternion.Angle(
Quaternion.identity,
m_CharacterLocomotion.DesiredRotation);
if (angle > m_MaxRotationAngle) {
m_CharacterLocomotion.DesiredRotation = Quaternion.Slerp(
Quaternion.identity,
m_CharacterLocomotion.DesiredRotation,
m_MaxRotationAngle / angle);
}
}
public override bool ShouldBlockAbilityStart(Ability startingAbility)
{
return startingAbility is ItemAbility ||
base.ShouldBlockAbilityStart(startingAbility);
}
public override void OnTriggerExit(Collider other)
{
base.OnTriggerExit(other);
// Keep crawling if another valid, overlapping trigger is still detected.
if (IsActive && m_DetectedObject == null) {
StopAbility();
}
}
}
Add/re-add Crawl after compilation so its new defaults apply. Add Item Equip Verifier if missing.

Confirm Start Type: Automatic, Stop Type: Manual, Object Detection: Trigger, Object ID: 101, and the intended Detect Layers. Set Max Trigger Object Count for simultaneous eligible overlaps, such as 4 for overlapping tunnel sections. Set Ability Index Parameter: 101, disable all Allow Equipped Items slot toggles, and enable Reequip Slots. The object’s ID filters detection; the ability index routes animation. They are independent despite both being 101 here.
Import the legacy animation
Use a project-owned clip or the legacy Mixamo Crawling example.

For that legacy clip, set Rig > Animation Type: Humanoid. Create an Idle clip from frames 0–1. On Idle and Crawling, enable Loop Time, Loop Pose, and Root Transform Rotation > Bake Into Pose. On Idle, also bake Root Transform Position (Y) and (XZ) into the pose to prevent idle displacement.


Configure the Animator branch
On Full Body, create Crawling with Idle and Crawl states:

| Transition | Conditions |
|---|---|
| Any State → Idle | AbilityIndex Equals 101, AbilityChange, Moving false. |
| Any State → Crawl | AbilityIndex Equals 101, AbilityChange, Moving true. |
| Idle → Crawl | Moving true. |
| Crawl → Idle | Moving false. |
| Each exit | AbilityIndex NotEqual 101. |

The original video demonstrates this scenario; use the Version 3 labels and API described here:
Verify both example lifecycles
For the minimal version, hold/release Crawl. The State should activate/clear, and the Animator should select index 101 then return to the next active index or 0.
For the tunnel version, approach with an item equipped. Item verification should unequip it before Crawl activates. Inside, the Animator should select Idle while still and Crawl while moving, with limited turning. Test overlapping valid triggers: leaving one should retain Crawl until the final valid exit. On completion, the Animator should exit, normal turning return, and the previous item re-equip. Repeat with critical interruptions.
For a missing custom type, resolve compilation/assembly references first. For failed tunnel activation, inspect trigger mode, layers, and matching object IDs. For no stop, preserve base.OnTriggerExit(other) and check remaining valid overlap. For no animation, compare index, parameter names, transitions, and Animator Monitor. For item-use leakage, check verifier/equipment dependencies and the ItemAbility block rule.
Developer reference
Request activation through locomotion so priority, preparation, active lists, and notifications remain coordinated:
using Opsive.UltimateCharacterController.Character;
var locomotion = character.GetComponent<UltimateCharacterLocomotion>();
var crawl = locomotion.GetAbility<Crawl>();
if (crawl != null) {
locomotion.TryStartAbility(crawl);
// Later:
locomotion.TryStopAbility(crawl);
}
Inside an ability, StartAbility() and StopAbility() route through the same controller.
| Hook | Responsibility |
|---|---|
CanStartAbility() |
Normal gameplay eligibility gate. Preserve base checks. |
AbilityWillStart() |
Final gate after conflict checks, before Move Towards / Item Equip Verifier preparation. |
AbilityStarted() / AbilityStopped(bool) |
Preserve base calls for State, input, attributes, overrides, and equipment cleanup. |
Update() |
Active work before movement; update Animator data here rather than deprecated UpdateAnimator(). |
UpdateRotation() / UpdatePosition() |
Contribute movement values. |
UpdateDesiredMovement() |
Modify Desired Movement after its calculation. |
ApplyRotation() / ApplyPosition() |
Validate/limit values before application. LateUpdate() follows movement. |
CanStopAbility(bool force) |
Permit or delay stop according to the requested force mode. |
ShouldBlockAbilityStart(Ability) |
Active ability decides whether to reject a new one. |
ShouldStopActiveAbility(Ability) |
Starting ability decides which active ones to stop. |
Preserve inherited trigger, initialization, update, stop, and destruction hooks. In particular, object detection owns its overlap list, and base destruction releases Starter/Stopper and model-switch registrations. Observe character activation with OnCharacterAbilityActive(Ability, bool) through Events.
See Abilities, Detect Object Ability Base, Move Towards Location, Animator Parameters, State System, and Input for shared behavior.