interaction
Interactable surfaces, interaction components, prompts, doors, switches, loot.
What it's for
This namespace builds the gameplay "interaction" layer onto your Blueprints and placed actors: the interactable interfaces, sphere components, trace settings, and prompt widgets that let a player walk up to something and use it. It also covers the common interactable archetypes you keep re-authoring by hand, like doors, chests, switches, and loot.
Reach for it when you want your assistant to wire up interaction on an asset for you, rather than clicking through the component panel and Details view yourself. You can add an interaction component and its trace distance, point a prompt at a Widget Blueprint, attach destruction health state, and set the little archetype-specific knobs, such as a door's open angle or a chest's loot table, in one request.
It targets interactable assets and actors, not the prompt widgets themselves. To author the prompt
Widget Blueprint, use ui and widget; this namespace only points an
interactable at an existing prompt widget class.
Examples
Make an actor in the level interactable
Add an interaction component to a placed actor and set how close the player has to be.
You: Make the Lever_01 actor in the level interactable within 200 units, line of sight required.
call("interaction.create_interaction_component_on_actor", {actorName:"Lever_01",
interactionDistance:200, requiresLineOfSight:true})
→ {ok:true, component:"InteractionSphere"}
Done. Lever_01 is now interactable within 200 units.
Set up a lockable door Blueprint
Configure the door archetype properties on an existing door Blueprint.
You: In BP_Door, make it open 90 degrees over half a second and start locked.
call("interaction.configure_door_properties", {doorPath:"/Game/BP_Door",
openAngle:90, openTime:0.5, locked:true})
→ {ok:true}
Done. BP_Door opens 90° in 0.5s and starts locked.
Add a chest with a loot table and a prompt
Set the chest properties, then point its interaction prompt at a prompt widget class.
You: Configure BP_Chest with a loot table and show WBP_Prompt when the player looks at it.
call("interaction.configure_chest_properties", {chestPath:"/Game/BP_Chest",
locked:false, lootTablePath:"/Game/Loot/DT_ChestLoot"})
→ {ok:true}
call("interaction.configure_interaction_widget", {blueprintPath:"/Game/BP_Chest",
widgetClass:"/Game/UI/WBP_Prompt", showOnHover:true})
→ {ok:true}
Done. BP_Chest uses DT_ChestLoot and shows WBP_Prompt on hover.