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 CrimsonCommon - no dependency on this plugin or anything else.

Prerequisites
The interacting pawn has an interact ability granted (Quick Start steps 5-9).

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 K2 Gather Interaction Options: Make CrimsonInteractionOption -> set fields -> Add to the Out Options array.
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 behaviours.
  • Concept: Two Activation Methods - grant-on-avatar vs activate-on-target-ASC.