Interaction Systems

Personal Project

Unreal Engine Trace Interaction System

Interaction Tracing

I coded an interaction trace with C++ to handle player interactions with objects in the game world. It primarily detects interactable object actors within range of the trace and allows the player to interact with them via a virtual interact function on the stored interactable actor when the interact input action is triggered. The interaction trace is run every frame so as to clear the interactable actor cached when the player is no longer looking at it and enable or disable interaction prompts when necessary.

This could be optimized easily by lowering the tick rate at which the trace checks for interactable objects.

Interactable Object Actor

The interactable object actor code stores a reference to the interaction prompt. This is used to hide or reveal the interaction prompt when necessary. Additionally the interactable object actor class is an inheritable class with a virtual function called Interact. This function can be overridden to provide multipurpose functionality for a variety of different uses, In this project it was used to handle item pickups, audio tapes, combination locks, doors, etc. It is extremely versatile and streamlines the process of creating new interactable actor types.

Interaction Prompts

The interact UI widget displays an interaction prompt in the game. It formats a text message dynamically based on the interaction type (e.g., "E: Pick Up" or “E: Open”). This allows designers to assign different interaction keywords for different interactable actor types and also allows for the interact button to change the displayed input as needed.