Skip to content

Interactor Component

Add Component > PlayMaker > Interactor

The Interactor component is the actor-side part of the Interactables system.

Add it to the player, character, or other GameObject that should search for nearby Interactables and activate them.

In PlayMaker, the main FSM entry point for using this component is the InteractorUpdate action.

What It Does

The Interactor:

  • scans for nearby Interactable colliders
  • filters them by layer, tag, distance, and other rules
  • chooses the best valid candidate
  • keeps track of the current focused Interactable
  • sends interaction system events when focus, availability, or activation changes

Typical Setup

  1. Add the Interactor component to the player or actor.
  2. Set Reference Transform if interaction checks should start from a child transform such as a camera, hand, or chest socket.
  3. Set Interactable Layers so the Interactor only scans relevant colliders.
  4. Set Search Radius to match the interaction distance you want for the actor.
  5. If needed, set Blocking Layers for line-of-sight checks.
  6. In the actor FSM, run InteractorUpdate every frame.
  7. Use the action's activation settings or pass manual input to trigger explicit interactions.

InteractorUpdate Action

InteractorUpdate is the action that connects an FSM to the interaction system.

It does four main jobs:

  • updates the assigned Interactor
  • evaluates nearby Interactables and selects the best valid target
  • handles optional activation input for explicit interactions
  • writes outputs and sends interaction system events

This means that adding an Interactor component by itself is not enough for PlayMaker-driven interactions. Your actor FSM should normally run InteractorUpdate every frame.

Activation Modes

InteractorUpdate can resolve activation in different ways:

  • None updates targeting only, without sending activation input
  • Manual lets your FSM supply a Boolean press value
  • MouseButtonDown activates from a mouse button down event
  • MouseButton activates while a mouse button is held

Use Manual when your project already handles input in FSMs and you want to pass a clean Use, Interact, or AltUse signal into the interaction system.

Outputs

InteractorUpdate can write useful outputs such as:

  • whether the current selection can interact this frame
  • the selected Interactable
  • the resolved target GameObject
  • the interaction name
  • the activation ID
  • the approach normal
  • the measured distance

It can also send a local event in the same FSM when a new interaction is activated.

Inspector Reference

Field Description
Reference Transform Optional origin for interaction checks. If empty, the Interactor GameObject transform is used.
Interactable Layers Layers that may contain Interactable colliders.
Blocking Layers Layers that can block Require Raycast Hit checks.
Hit Triggers Controls whether overlap checks include trigger colliders.
Required Tag Optional tag filter applied to the Interactable target GameObject.
Search Radius How far the Interactor searches from the reference transform.

How Target Selection Works

Each update, the Interactor evaluates nearby candidates and keeps the best valid Interactable.

Selection depends on:

  • whether the collider resolves to an Interactable
  • whether the target matches the required tag
  • distance and position rules on the Interactable
  • inside-trigger checks
  • approach and facing requirements
  • raycast-hit requirements
  • Interactable priority

If multiple Interactables are valid, the system prefers the strongest valid candidate rather than simply taking the first collider it finds.

Choosing a Reference Transform

The reference transform matters because it defines where distance, overlap, and raycast checks start.

Common choices:

  • the player root for simple third-person interactions
  • the camera for first-person interactions
  • a hand or chest transform for interactions that should start from the character body

If interactions feel too short, too long, or slightly offset, the reference transform is one of the first settings to check.

Example: First-Person Player

For a first-person controller:

  1. Add an Interactor to the player root.
  2. Assign the camera as the Reference Transform.
  3. Set Interactable Layers to the layers used by interactive objects.
  4. Set a reasonable Search Radius, such as the maximum distance the player should be able to use objects.
  5. If your Interactables use Require Raycast Hit, make sure Blocking Layers includes level geometry that should block line of sight.
  6. Run InteractorUpdate every frame in the player FSM.
  7. If the interaction requires a Use input, pass that input through InteractorUpdate, usually with Manual activation mode.

This setup works well for doors, switches, pickups, and terminals where the player is expected to look at the target before using it.

Events and Outputs

The Interactor drives the interaction system events described in the overview:

  • OnInteractAvailable
  • OnInteractUnavailable
  • OnInteractFocus
  • OnInteractLostFocus
  • OnInteractStart
  • OnInteract
  • OnInteractEnd

These events can carry the selected Interactable, target GameObject, interaction name, activation ID, approach normal, and measured distance.