2.6 KiB
2.6 KiB
DA_InteractionData — Data Asset
Parent Class: UDataAsset
Dependencies: BPC_InteractionDetector, I_Interactable
Purpose: Defines interaction properties for interactable world objects — prompt text, hold duration, required items, and context tags.
Variables / Structure
| Field | Type | Description |
|---|---|---|
InteractionTag |
FGameplayTag |
Unique tag for this interaction type |
ActionLabel |
FText |
"Open", "Pick Up", "Pull Lever", etc. |
ObjectName |
FText |
Display name of the object |
bRequiresHold |
bool |
Whether interaction requires hold input |
HoldDuration |
float |
Seconds to hold (if bRequiresHold) |
ActionKeyIcon |
UTexture2D* |
Platform-specific input icon |
ContextTags |
TArray<FText> |
Display tags: "Safe", "Locked", "Dangerous" |
bConsumeOnInteract |
bool |
Item is consumed after interaction |
InteractionCooldown |
float |
Seconds before re-interaction allowed |
RequiredItemTag |
FGameplayTag |
Item required in inventory to interact |
bBlockDuringCombat |
bool |
Interaction blocked during combat |
InteractionRange |
float |
Max distance for interaction (cm) |
PromptOffset |
FVector2D |
Screen offset for prompt widget |
Gameplay Tags
- Namespace:
Interaction.<Type>(e.g.,Interaction.Open,Interaction.Pickup) - Required item tags in
Item.<Category>namespace
Validation Rules
ActionLabelmust not be emptyHoldDuration> 0 ifbRequiresHoldis trueInteractionTagmust be unique across all interaction DAsInteractionRangemust be > 0
Example Data
Example 1: Door
| Field | Value |
|---|---|
| InteractionTag | Interaction.Door.Open |
| ActionLabel | "Open" |
| ObjectName | "Wooden Door" |
| bRequiresHold | false |
| InteractionRange | 200.0 |
Example 2: Locked Chest
| Field | Value |
|---|---|
| InteractionTag | Interaction.Chest.Locked |
| ActionLabel | "Unlock" |
| ObjectName | "Iron Chest" |
| bRequiresHold | true |
| HoldDuration | 1.5 |
| RequiredItemTag | Item.Key.IronKey |
Consumed By
BPC_InteractionDetector— reads interaction data for prompt displayBP_DoorActor— door-specific interaction configBP_PuzzleDeviceActor— puzzle interaction definitions
Reuse Notes
- All interactable objects reference this DA via a
TSoftObjectPtron their component - Context tags drive HUD prompt coloring and iconography