Detect Ground Ability Base
Detect Ground Ability Base restricts a derived ability to eligible supporting ground. Use it for a platform, ledge, or surface that must pass layer, identity, normal, and facing checks. It is abstract: add a concrete derived ability, such as an add-on’s Balance, Ledge Strafe, or Dive, rather than this base type.
Configure valid ground
- Select the concrete ability in Ultimate Character Locomotion > Abilities and configure its own gameplay/start requirements.
- Include the ground Collider’s layer in Layer Mask.
- For layer-only filtering, leave Object ID: -1. For a specific identity, add Object Identifier to the same GameObject as the ground Collider, then enter its matching ID on the ability.
- Configure the required surface normal and facing angle before activation. The character must be grounded for this base check to succeed.
- If several facing directions should qualify, configure Object Forward Faces on the ground object or a parent and test the intended face count with the angle threshold.
| Inspector field | Default | Purpose |
|---|---|---|
| Layer Mask | All layers | Broad identity filter. Narrow it to the intended ground layers. |
| Object ID | -1 | Disable the additional identifier test. Another value requires a matching Object Identifier and an allowed layer. |
| Ground Normal Sensitivity | 0.5 | Minimum dot product of character up and ground normal. Higher values require a flatter surface relative to character up. Range 0–1. |
| Angle Threshold | 180 degrees | Maximum facing difference from the ground Transform’s forward direction, with any configured forward-face adjustment. Lower for stricter approach facing. |

A matching ID never bypasses Layer Mask. Keep the ID on the collider GameObject; an identifier only on a parent is not the ground-ID setup used here. The concrete ability can add requirements beyond these filters, such as a nearby wall or water beneath a diving platform.
Own moving-ground attachment
The hidden MoveWithObject option is available to derived code or a custom drawer. Its default is false. When enabled, the base can assign the detected ground as the locomotion moving platform if no platform is already owned. On stop, it releases that relationship when the current platform still matches its ground.
Use Moving Platforms for ordinary ground-based platform movement. Expose MoveWithObject only when the derived ability deliberately owns that temporary attachment; do not compete with a separate platform owner.
Verify the ground filters
- Provide one valid and one invalid ground object, and meet the concrete ability’s other start requirements. The ability should show (Active) only on eligible grounded contact.
- Test allowed/disallowed layers and matching/mismatching Object IDs separately. A valid ID on a disallowed layer should remain rejected.
- Test slopes on both sides of Ground Normal Sensitivity, then facing inside/outside Angle Threshold. Repeat every intended Object Forward Faces direction.
- Step onto invalid ground or become airborne. The base’s active ground check should request a stop. Confirm the derived ability’s stop policy allows the intended release.
- If
MoveWithObjectis enabled, move and rotate the support. Confirm the character follows during the ability and the intended moving-platform ownership is restored on stop.
For no activation, inspect grounding, layer, same-object identifier, normal, angle, and the concrete ability’s own requirements. For rejection only on slopes, lower the normal sensitivity deliberately. For an unintended facing restriction, rotate the ground Transform, increase the angle, or configure forward faces.
Developer reference
DetectGroundAbilityBase exposes ObjectID, LayerMask, NormalSensitivity, AngleThreshold, and MoveWithObject. Ground Normal Sensitivity maps to NormalSensitivity.
CanStartAbility runs base ability gates and the supporting-ground check. IsValidGroundObject(GameObject) applies ID/layer filters; protected IsOverValidObject methods also check contact, normal, and angle. Active Update rechecks supporting ground and requests stopping when invalid.
Preserve base calls when overriding initialization, CanStartAbility, AbilityStarted, Update, and AbilityStopped, so validation and attachment cleanup remain intact. New Ability covers authoring; Detect Object Ability Base detects nearby or targeted objects instead of supporting ground. Included Abilities routes to concrete workflows.