ODK Interactions

Documentation for ODK Interactions

The ODK interaction system facilitates interactions between the player character and in world props.

Basic Interaction Flow

Player characters have the BPC_ODK_InteractionComponent attached to them. All interactable actors have a BPC_ODK_InteractableComponent attached to them. The BPC_ODK_InteractionComponent periodically polls interactable components to see which is the current BPC_ODK_InteractableComponents the player can interact with in the world. When the player inputs the "Interact" input action event, the BPC_ODK_InteractionComponent will inform the currently interactable BPC_ODK_InteractableComponent that it needs to execute it's logic.

Setting up a new Interaction

If you want to set up a new prop actor to have interactions, the simplest method is to attach a BPC_ODK_InteractableComponent_WidgetPopup to your actor. Once this is done, select the component in the "Viewport" and move it to an appropriate position on your actor. This should be a location where you expect the camera to be looking when the player interacts with the object. Now, you can hook into events on the component to execute your behaviour: - OnInteract: Execute your custom interaction logic - OnFocused: Marks the interactable component as the active target, allowing it to receive interaction input when the player presses the designated key. - OnUnfocused: Removes the component as the active target, preventing it from receiving interaction input. Lastly, we can configure the BPC_ODK_InteractableComponent_WidgetPopup properties: - Interaction Distance: the distance within which the player character needs to be to interact with this component. - Priority: If multiple interactables are able to be interacted with at one time, the highest priority interactable will take precedence. - Widget Transform: Allows you to configure where the popup widget will be displayed in relation to your actor. We recommend setting the widget to sit above your actor.

Last updated