Appearance
World interaction
Add the RicInteraction dependency to code using this system.
For component settings, the supplied UI, and ready-made pickup actors, see the Blueprint Interaction system section.
Point and interactor
URicInteractionPoint is a replicated scene component on an interactable actor. Its position is the interaction location. Configure fragments and tags on the component.
URicInteractorComponent belongs to the player's pawn. It discovers points, tracks the selection, informs UI listeners, and submits interaction requests through the owning actor.
Configure an InteractionStrategy on the interactor. The native property is protected; assign it in component defaults or in your interactor subclass.
Default discovery strategy
URicInteractionStrategyClosestVisiblePoint uses the interaction subsystem's spatial grid, distance, view angle, and line of sight.
Defaults:
MaxDistance = 500Unreal units for discovery.MaxAngleDegrees = 45.MaxBestPointDistance = 200for the selected point.TraceChannel = ECC_Visibility.bTraceComplex = false.
Interactor PointsUpdateInterval defaults to 0.1 seconds. Automatic search runs for an active, locally controlled pawn and does not run on a dedicated server. Use Activate() and Deactivate() to control search.
Points are indexed by the interaction subsystem. RefreshSpatialIndex() explicitly updates a point after a position change when needed.
Visibility and availability
Visibility and permission are independent:
CanShowInteractionPoint()andSetShowInteractionPoint()control presentation through the Hidden tag.IsInteractionEnabled()andSetInteractionEnabled()control enabled state through the Disabled tag.CanInteract(Interactor)evaluates current availability.
Use SetInteractionEnabled() on authority; its tag state replicates. A visible point can be disabled and still show a prompt explaining why it cannot be used.
Execute from input
cpp
#include "Components/RicInteractorComponent.h"
bool TryInteract(URicInteractorComponent* Interactor)
{
return Interactor && Interactor->CanInteractWithSelectedPoint()
&& Interactor->ExecuteInteraction();
}Bind this helper to your game's interaction input. SelectedPoint and VisiblePoints are available for presentation.
When bSendServerEvent is enabled, the interactor sends the server request through its own component. This route is appropriate for world actors the player does not own.
OnClientExecuteInteraction and OnServerExecuteInteraction report the result and interactor. Put authoritative gameplay changes in server execution. The immediate return value is not proof of a completed server effect.
UI listeners
Implement IRicInteractionInterface and register a script interface with the interactor. Callbacks are:
OnInteractionAvailable/OnInteractionUnavailable.OnInteractionSelected/OnInteractionDeselected.OnInteractionExecute.
In native classes, implement the corresponding _Implementation methods. Unregister listeners when a widget closes.
The interactor reports availability differences and selection changes. Use them to add/remove prompts and update the highlighted point.
Custom fragments and selection
URicInteractionFragmentName supplies display-name configuration. Custom URicInteractionFragment subclasses initialize point configuration through their creation hook. Integrate availability and execution through point state and delegates. A custom URicInteractionStrategyBase changes discovery and selection.
Search and visibility are client presentation rules. For locked chests, pickups, or trades, authoritative gameplay must also validate distance, ownership, access, and whether the interaction is still valid.