C++ API Reference
This section highlights the main C++ types you typically interact with.
Public headers
Core:
Public/Data/EDInteractionTypes.h
Components:
Public/Components/EDIPlayerControllerComponent.h(UEDPlayerInteractionComponent)Public/Components/EDInteractableComponent.h(UEDInteractableComponent)Public/Components/EDInteractionGameStateComponent.h(UEDInteractionGameStateComponent)Public/Components/EDInteractionFragment.h(UEDInteractionFragment)
UI:
Public/UI/EDInteractionWidget.h(UEDInteractionWidget)Public/UI/EDInteractionViewModel.h(UEDInteractionViewModel)
Utilities:
Public/Library/EDInteractionLib.h(UEDInteractionLib)
Interfaces:
Public/Interfaces/EDInteractionNotifier.h(UEDInteractionNotifier/IEDInteractionNotifier)
Settings:
Public/Settings/EDInteractionSettings.h(UEDInteractionSettings)
Key runtime ownership
UEDPlayerInteractionComponentshould be owned by aAPlayerController.UEDInteractionGameStateComponentshould be owned byAGameStateBase(server authority).UEDInteractableComponentshould be owned by interactable actors.
Typical usage patterns
Start/stop interaction from code
if (UEDPlayerInteractionComponent* Comp = MyPC->FindComponentByClass<UEDPlayerInteractionComponent>())
{
Comp->Interact(true);
}
Listen to interaction events on an interactable
InteractableComponent->OnInteractionSuccessful.AddDynamic(this, &AMyActor::OnInteracted);
Implement the notifier interface
Implement UEDInteractionNotifier on your Pawn or PlayerController to receive centralized callbacks.
Example callbacks:
Local_OnInteractionDeniedLocal_OnInteractionServer_OnInteraction
MVVM extensions (fragments)
Derive from UEDInteractionFragment and return a UMVVMViewModelBase* from OnInteractionStarted_Implementation.
The returned ViewModel is registered on the base UEDInteractionViewModel and can be retrieved by class.
Settings access
const UEDInteractionSettings* Settings = GetDefault<UEDInteractionSettings>();
Server validation selection
The server validation policy is driven by:
Settings->ServerInteractionValidationType
And executed inside:
UEDPlayerInteractionComponent::TraceValidationActorUEDPlayerInteractionComponent::TraceValidationFoliage