How-To: Make an Actor Interactable

Goal: expose one or more interaction options on an actor (or a component) so the scan picks it up. Being interactable needs only this plugin's interface - no other dependency.

Prerequisites
The interacting pawn has an interact ability granted (Quick Start step 5, or your own from How-To: Write Your Own Interact Ability).

1. Implement the interface

ICrimsonInteractableTarget is BlueprintType. Implement it on an AActor or on any UActorComponent (a component's options are attributed to its owning actor). The C++ GatherInteractionOptions default-forwards to the Blueprint K2 Gather Interaction Options, so a Blueprint-only target works with no C++.

CrimsonCore (requires all Crimson plugins)
If your project has all Crimson plugins installed, ACrimsonInteractableActor (CrimsonCore) already implements the interface and exposes an Interaction Options array in the Details panel plus an On Interacted event - zero graph code. Otherwise, the interface path below is the way (and it is barely more work).

2. Return your options

Each option carries display text and how it activates. In Blueprint, add options to the Out Options array of K2 Gather Interaction Options - the system stamps each option with its owning target for you. In C++, push them through the builder, which does the stamping.

In your K2 Gather Interaction Options override: Make CrimsonInteractionOption -> Add -> Return Node. On the Make node set Text = Open and SubText = Requires a key, pick an Input Type, and point Interaction Ability To Grant at your handler ability. The Add node's Target Array is the event's Out Options pin.

There is no builder node in Blueprint - Out Options is the whole story, and the system stamps Interactable Target onto every option you add. Add more than one Make / Add pair and the target offers several options; the interactor picks index 0 unless you arbitrate (How-To: Override Which Option Is Chosen).

Verify
Walk into range. With debug on (bShowDebugByDefault in settings, or the debug flag on your scan task call) the scan draws over the actor and your prompt shows Option.Text.

3. Check the collision

The scan finds the actor through its collision: at least one component must overlap (not necessarily block) the Interaction Trace Channel (Visibility by default - any default-collision actor passes). For a dedicated setup, assign the shipped Interactable_OverlapDynamic profile - see How-To: Configure Collision.

4. (Optional) enrich the gameplay event - C++ only

Override CustomizeInteractionEventData to attach context (set OptionalObject, stamp a magnitude) just before the ability fires. This is a plain C++ virtual - Blueprint targets cannot override it.

cpp
void AChest::CustomizeInteractionEventData(const FGameplayTag& Tag, FGameplayEventData& InOut)
{
InOut.OptionalObject = this; // e.g. so the handler ability can read chest contents
}

See also

  • How-To: Instant, Hold & Duration Interactions - the InputType behaviors.
  • Concept: Two Activation Methods - grant-on-avatar vs activate-on-target-ASC.