An Unreal Engine plugin contains components for integration of the simple interaction system in a prototype.
The plugin can be used in both C++ and Blueprint projects.
- Download the latest package file;
- Install the plugin either in your project or for all projects in engine:
- Unzip the package into Plugins folder of your project, e.g.
D:\UnrealProjects\MyProject\Plugins
; - Unzip the package to the Plugins folder in engine folder, e.g.
C:\Program Files\Epic Games\UE_5.0\Engine\Plugins
;
- Unzip the package into Plugins folder of your project, e.g.
- Restart the project;
In this case the plugin can be used for any blueprint project.
- Create the Plugins folder in the project directory;
- Create the TrickyAnimationComponents folder in the Plugins folder;
- Download the plugin source code into that folder;
- Rebuild the project;
The plugin contains:
- InteractionQueueComponent;
- InteractionInterface;
- InteractionLibrary;
- Interaction Triggers;
This component handles creating a queue for interaction which it sorts by weight and line of sight.
InteractionQueue
- current interaction queue;- It's read only and exposed for debug purposes;
FinishManually
- if true theFinishInteraction
function must be called manually through the code;UseLineOfSight
- toggles the line of sight checks;- Keep it false if there's no interactive actors require line of sight checks in your game;
TraceChannel
- the trace channel used for line of sight checks;- Currently read only;
SightDistance
- the line of sight max distance;SightRadius
- the line of sight radius;ActorInSight
- the actor caught by line of sight;
Add
- adds interaction data into the interaction queue;Remove
- removes interaction data from the interaction queue;StartInteraction
- starts interaction with the first actor in the interaction queue;FinishInteraction
- finishes the interaction action. Call it if 'StopInteraction
- stops interaction;IsQueueEmpty
- checks if the interaction queue is empty;QueueHasActor
- checks if the interaction queue has interaction data with the given actor;GetFirstInteractionData
- returns the first interaction data in the interaction queue;GetFirstActor
- returns the first actor in the queue;GetFirstDataInQueue
- returns the first interaction data in queue;GetInteractionData
- returns the interaction data of the given actor;UpdateInteractionMessage
- updates interaction message of the given actor in the interaction queue;UpdateInteractionTime
- updates interaction time of the given actor in the queue;
OnInteractionStarted
- called when the interaction process started;OnInteract
- called when the interaction effect successfully activated;OnInteractionStopped
- called when the interaction process stopped;OnActorAdded
- called when a new actor was added to the queue;OnActorRemoved
- called when an actor was removed from the queue;
The struct which contains parameters for interaction behaviour adjustments.
bRequireLineOfSight
- toggles if the actor require being in the line of sight to be interacted;InteractionMessage
- a message which can be used in HUD;SortWeight
- a sort weight for sorting the interaction queue;InteractionTime
- how much time required to activate interaction effect (callInteract
function);
The interface which used to implement the interaction functionality in the chosen actor.
StartInteraction
- this function called when the interaction queue component starts the interaction;FinishInteraction
- this function called to activate the interaction effect returnstrue
if success, elsefalse
;StopInteraction
- this function called when theStopInteraction
called from the interaction queue component;
A library which contains some useful functions for custom implementation of the system using Blueprints.
GetPlayerViewpoint
- returns player's viewport location and rotation;GetInteractionComponent
- returns InteractionQueueComponent if the given actor has one;IsInteractionQueueEmpty
- checks if the interaction queue is empty;AddToInteractionQueue
- adds custom interaction data to the interaction queue component of the given actor;RemoveFromInteractionQueue
- removes interaction data from the interaction queue component of the given actor if it was found;HasInteractionInterface
- checks if the given actor hasInteractionInterface
;InteractionQueueHasActor
- checks if the interaction queue has a given actor in it;GetInteractionData
- returns interaction data of the given actor;GetFirstQueueData
- return the first data in the queue;UpdateInteractionMessage
- updates the interaction message of the given interactive actor;
A small collection of trigger components which add and remove their owning actor from the interaction queue.
- BoxInteractionComponent;
- CapsuleInteractionComponent;
- SphereInteractionComponent;
InteractionData
- interaction data which will be added to the interaction queue;
SetInteractionMessage
- sets interaction message in theInteractionData
and updates it in the interaction queue;
OnActorAdded
- called when the owning actor was added to the queue;OnActorRemoved
- called when the owning actor was removed from the queue;
- Add InteractionQueueComponent to your character;
- Create an interactive actor:
- Add InteractionInterface to the chosen actor and write the logic in the
Interact
function; - Add an interaction trigger;
- Adjust interaction data in the trigger;
- Add InteractionInterface to the chosen actor and write the logic in the
- Create "Interaction" input action;
- Call the
StartInteraction
function of InteractionQueueComponent;