Appearance
Interaction System
The Interaction System provided by PulseAbility allows objects in the world to easily communicate with players and trigger logic—fully replicated for multiplayer and thoroughly decoupled.
Gameplay Abilities System (GAS) Foundation
Under the hood, the Pulse Core Interaction System leverages Epic's robust Gameplay Abilities System (GAS). This allows interactions to be treated as formal UGameplayAbility instances, bringing you built-in state management, cost, and cooldown handling.
To use the system, your player character must have an Ability System Component (ASC) and grant the relevant interaction ability. Pulse Core ships with two base interaction abilities:
- Normal Interact Ability: Executes locally or handles its own generic execution without forced replication overhead.
- Replicated Interact Ability: Designed specifically for multiplayer. When triggered by the client, GAS automatically requests the server to execute the interaction authoritatively, preventing cheating and syncing the world state across all connected players.
1. How to Trigger Interactions
There are three different ways an interactor can find and focus on interactable objects:
1. Per Trace
A trace (raycast) is performed continuously at a specified interval using a specific trace channel. The interactable object remains in focus as long as the trace continues to hit it. This is ideal for first-person or over-the-shoulder perspectives where you need to look directly at the object.
2. Per Component
This method searches the interactor actor for a specific component that has a tag matching the InteractableComponentTag defined in the interaction ability. It then uses this component to check for overlaps. The interactable object remains in focus as long as the component is overlapping it. This is highly flexible and allows you to use any custom collision shape attached to the player.
3. By Sphere
This works similarly to the "Per Component" method, but instead of searching for an existing tagged component, a Sphere Component is automatically created on the interactor and used to check for overlaps. This is perfect for quick, proximity-based interactions without needing extra setup on the player actor.
2. Making Objects Interactable
For an object to be recognized by the interaction system, it must implement the IPulseInteractableInterface.
You can fulfill this requirement in two ways:
- Implement it on the Actor: The Actor itself implements the interface.
- Implement it on a Component: One or more components attached to the Actor implement the interface (e.g., a specific
UPulseInteractableComponent).
Selection Priority
- Actor Priority: If the Actor itself implements the interface, the system will always prioritize the Actor and ignore its components.
- Multiple Components: If the Actor does not implement the interface, but multiple attached components do, the system uses the
UPulseInteractComponentSelectorto determine which component should be used for the interaction.
