Skip to content

Interaction Trace And Prompt

The interaction system answers this every frame:

What capability-bearing object is the player looking at right now?

The answer is stored as FocusedObject on AAndromedaCharacter. The focused object may be prompt-only, carryable, interactable, or a combination.

Trace Resolution

AAndromedaCharacter::UpdateFocusedObject traces forward from the first-person camera using the configured interaction trace channel. If the carry component is holding an actor, that held actor is excluded from the trace so carried geometry does not block workstation or placement targeting.

ResolveFocusableFromHit asks only the hit actor whether it implements IAndromedaFocusCandidateProviderInterface. If it does, that actor owns the routing decision and its returned object is the only focus candidate considered for the hit.

If the hit actor is not a provider, focus resolution stops. The character does not scan every component on the actor and does not implicitly focus objects just because they are promptable, carryable, or interactable. Actors inspect the full FHitResult and decide whether the hit component should route to an actor or component focus candidate.

Prompt Flow

Prompts are owned by IAndromedaPromptableInterface, not by pickup or interaction. A focused object shows a prompt only when it implements promptable and CanShowPrompt(ViewingPawn) succeeds. Action-capable objects can still respond to E without showing a prompt.

The character broadcasts OnFocusedObjectChanged(OldFocusedObject, NewFocusedObject). AAndromedaHUD listens to focus changes, resolves prompt text from the focused object when it is promptable, and updates WBP_InteractPrompt, or clears it when the prompt text is empty.

State Changes

Promptable objects expose prompt invalidation through GetPromptEvents. While focused, the HUD subscribes to OnCapabilityChanged on that event source and refreshes the latest prompt directly.

That event is not a UI event. It is a prompt-capability invalidation signal for same-focus changes such as pickup availability, workstation usability, or prompt text changes.

Interact Input

IA_Interact remains contextual:

if placement mode is active:
    commit placement
else if carry component can pick up the focused object:
    ask CarryComponent to carry the focused actor
else if focused object is interactable:
    execute generic interaction
else:
    do nothing

These branches live directly in AAndromedaCharacter::InteractInput, keeping the input handler shaped like the actual priority order: placement, pickup, then generic interaction.