Interact lets a character detect an object, approach an optional pose, and trigger one or more responses at a deliberate animation point. The object’s Interactable coordinates the targets; separate interaction and completion events control contact and release.

Add Interact to the character

  1. Add Interact under Ultimate Character Locomotion > Abilities. Defaults are Start Type Button Down, Input Names Action, and Ability Index 9.
  2. Configure object detection, layers, and optional Object ID. Trigger suits proximity; casts suit facing/aim selection.
  3. Leave Interactable ID -1 for general use or match the target Interactable’s ID for distinct animation/input groups.
  4. Add Move Towards above Interact for precise approach; put optional pathfinding above Move Towards. Keep critical interrupts above Interact.
  5. Set Ability Int Data Value for the animation branch and configure timing, overlap, and IK below.

Build a button interaction

  1. Add Interactable to the button. In Targets, assign a Moving Platform and an Animated Interactable on the button.

Button Inspector with an Interactable component that links the character to the button targets

  1. Enable Enable On Interact on the platform. Give the button an Animator and set Animated Interactable’s Trigger Parameter to its exact trigger, such as Press. Assign actual components implementing IInteractableTarget; every entry must be valid.

Interactable Targets array connected to a Moving Platform and an Animated Interactable with Trigger Parameter set to Press

  1. Put Move Towards Location on the same GameObject as Interactable and align it to the character’s contact pose. Interact reads locations from that exact object.

Move Towards Location gizmo positioned in front of the button for the character interaction pose

  1. For proximity detection, add a trigger on the button or a child, on a detected layer. Interact can find the parent Interactable.

Button interaction trigger volume surrounding the area where the character can use the button

Every target must return true from CanInteract before the interaction starts. At Interact Event, all targets run once in array order.

Choose response and timing

Animated Interactable control Result
Trigger Parameter Fires an Animator trigger on each interaction.
Bool Parameter / Bool Interact Value Sets the bool; Toggle Bool Interact Value supports alternating states.
Single Interact Limits use until ResetInteract is called.
Interact Audio Clips Advances sequentially across interactions.
Bool Enabled Message / Bool Disabled Message Supplies the next state’s prompt text.
Interact timing Default Animation callback when waiting is enabled
Interact Event Timed, 0.2 seconds OnAnimatorInteract: invokes target responses.
Interact Complete Event Timed, 0.2 seconds OnAnimatorInteractComplete: ends the ability after response.

Put the response event at hand contact and completion near the end of the character clip. Each reachable clip must provide its configured callbacks, or use tested durations.

For limb contact, add Ability IK Target components below Interactable and configure Goal, Delay, Interpolation Duration, and Duration. Use immediate targets for interruptible interactions. Use delayed starts only when the interaction remains active through them; own cancellation in project code if early interruption is required. Stopping releases applied IK targets.

Configure prompts and overlap

Ability Message Text accepts a fixed prompt or {0}, such as PRESS F TO {0} DOOR. The first target implementing IInteractableMessage supplies replacement text; Animated Interactable can alternate OPEN/CLOSE messages.

Ability option Effect
Allow Active Height Change Preserves an already active Height Change when compatible with the contact pose.
Allow Aim Preserves existing Aim; new item abilities remain blocked during Interact.
Concurrent Allows compatible overlap while still blocking Item Abilities, Stored Input abilities, and lower-priority abilities.

Object ID filters the inherited detector; Interactable ID selects an Interactable group. Arrival uses component references rather than either ID. Leaving a trigger during an active interaction lets it finish; stopping clears the candidate/reference so a new use requires detection again.

Verify the complete chain

Approach the trigger or aim the cast and confirm Detected Object and the expected prompt. Request interaction outside the arrival pose: Move Towards should align first, then Interact should become active with the configured AbilityIntData.

At the response event, the button and platform should each respond once; at completion, control should resume and applied IK should release. Test a target rejecting CanInteract, toggle/single-use behavior, trigger exit during activity, and interruption with the chosen immediate-IK policy.

Symptom Check Fix
Detected but no start IDs, every target, CanInteract Assign valid available targets and matching IDs.
Alignment skipped Ability order and location owner Put Move Towards above Interact and the location on Interactable itself.
Wrong response frame or stuck ability Separate timing settings Supply each exact callback or its tested duration.
Limb or prompt incorrect IK hierarchy/timing; {0} and message target Use valid immediate targets and the intended message provider.

Developer reference

IInteractableTarget receives the character and active ability:

API declaration
bool CanInteract(GameObject character, Interact interactAbility);
void Interact(GameObject character, Interact interactAbility);
API declaration
string AbilityMessage();

The first example declares target validation/response; the second declares dynamic prompt text. Interact exposes InteractableID, AllowActiveHeightChange, AllowAim, Concurrent, AbilityIntDataValue, InteractEvent, InteractCompleteEvent, and current Interactable. Preserve base cleanup in extensions. See Animation Event Trigger and Item Abilities for timing and blocked action ownership.