- Pick up items
- Open containers
- Harvest foliage and resources
- Trigger custom world interactions (chests, levers, traps, etc.)
UInteractionComponent placed on the Player Controller to centralize all interaction logic.
Location:/Public/InteractionSystem/InteractionComponent.h
Using UMI with the Interaction System
What InteractionComponent Does
UInteractionComponent is responsible for:
- Raycast / shape traces to detect interactable objects
- Range validation and line-of-sight checks
- Instant and hold-to-interact actions
- Tool requirements (e.g., requires pickaxe)
- Optional interaction animations
- Foliage interaction support (for foliage-based resources)
Setup
Add InteractionComponent to Player Controller
Important: InteractionComponent goes on the Player Controller, not the Character.
Blueprint Setup
- Open your Player Controller Blueprint
- Add Component → Interaction Component
- Configure properties, for example:
Trace Distance:500(cm)bUseSphereTrace:trueSphereTraceRadius:20bDrawDebugTrace:false
Best Practices
- Use sphere traces over pure line traces for friendlier targeting.
- Always show clear prompts (“Press E to Pick Up”, “Hold E to Harvest”).
- Enforce range and line-of-sight to avoid weird interactions.
- Use hold interactions for harvesting and longer actions.
- Add animations and progress bars for good feedback.
- Make all important interactions server RPCs.
- Use tool requirements to gate advanced resources (pickaxe, axe, etc.).
- Test at different FOVs and distances to ensure comfortable interaction.