How-To: Get the Building Blocks
Goal: know how to reach every prerequisite the other pages assume - the option struct, the query, the ability system component, the task nodes, the statics, and the project settings. Everything on this page uses only CrimsonInteraction and engine types.
The interaction option
FCrimsonInteractionOption is the unit of currency: one thing the player can do to one target. You create options inside a target's gather callback. In Blueprint you add them to the Out Options array pin of K2 Gather Interaction Options; in C++ you push them through the FCrimsonInteractionOptionBuilder (the builder is C++-only - Blueprint never sees it, the interface handles the stamping for you).
Inside a K2 Gather Interaction Options override: Make CrimsonInteractionOption -> Add (Target Array = the event's Out Options pin). On the Make node, the pins you author are Text, SubText, Interaction Ability To Grant, Interaction Widget Class, Input Type, Input Hold Duration, Interaction Action Ability, Conditions and Condition Sets.
Leave Interactable Target, Target Ability System, Target Interaction Ability Handle and Requirements unwired - the plugin fills those in. There is no builder node in Blueprint; Out Options is the whole story.
ECrimsonInteractionInputType has exactly two values: Instant and Hold.The interaction query
FCrimsonInteractionQuery tells targets who is asking. The scan tasks pass it to every GatherInteractionOptions call. You build one when spawning a scan task.
Inside a Gameplay Ability graph: Make CrimsonInteractionQuery with Requesting Avatar = Get Avatar Actor From Actor Info, and Requesting Controller = that same actor -> Cast To Pawn -> Get Controller. Optional Object Data is yours - anything your targets want to read out of the query.
Do not reach for Get Player Controller (Player Index = 0) here: on a listen server it returns the host's controller for every player. The avatar's own controller is always the right one.
The ability system component
All discovery goes through the engine's own interface - no Crimson types needed. In Blueprint use the Get Ability System Component node (target = any actor); in C++ use UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(Actor) or implement IAbilitySystemInterface on your pawn/player state.
The task nodes
The scan and grant tasks are ability tasks: their factory nodes appear only inside a Gameplay Ability graph (Blueprint) or compile only inside a UGameplayAbility subclass (C++). The node names:
| Blueprint node | C++ factory | Runs on |
|---|---|---|
Wait For Interactable Targets Single Line Trace | UCrimsonAbilityTask_WaitForInteractableTargets_SingleLineTrace::WaitForInteractableTargets_SingleLineTrace | Owning client |
Wait For Interactable Targets Top Down Trace | UCrimsonAbilityTask_WaitForInteractableTargets_TopDownTrace::WaitForInteractableTargets_TopDownTrace | Owning client |
Grant Abilities For Nearby Interactors | UCrimsonAbilityTask_GrantNearbyInteraction::GrantAbilitiesForNearbyInteractors | Server only (self-bails on clients) |
The statics library
UCrimsonInteractionStatics is a Blueprint function library - its nodes are available anywhere:
| Node | Purpose |
|---|---|
Trigger Interaction Option | Fire an option's ability by replicated spec handle (back-fills the target ASC/handle, calls the target's payload hook). The one node your press handler needs. |
Get Actor From Interactable Target | Resolve the owning actor from a target interface reference (actor or component implementer). |
Get Interactable Targets From Actor | All interface implementers on an actor: the actor itself plus matching components. |
Append Interactable Targets From Hit Result | Collect implementers from a trace hit (used when writing custom scan tasks). |
Get Context Actions For Actor | Wrap an actor's options as transient context-menu actions (deterministic client/server order). |
The project settings
Project Settings -> Crimson -> Crimson Interaction (UCrimsonInteractionSettings, stored in DefaultCrimsonInteraction.ini) holds the scan defaults. In C++ read them with UCrimsonInteractionSettings::Get(). The properties are not Blueprint-readable - in Blueprint, type the values you need into your ability's own defaults.
#include "CrimsonInteractionSettings.h" // CrimsonInteractionconst UCrimsonInteractionSettings* S = UCrimsonInteractionSettings::Get();const TEnumAsByte<ECollisionChannel> Channel = S->InteractionTraceChannel; // default: Visibilityconst float Range = S->DefaultScanRange; // default: 500const float Rate = S->DefaultScanRate; // default: 0.1
See also
- Quick Start - puts every block on this page to work.
- API Reference - exact signatures, factory parameters, and settings defaults.