Skip to content

Interactor Update

Updates an Interactor, evaluates nearby Interactable components, and handles activation input for explicit interactions.

What It Does

  • Updates the assigned Interactor
  • Evaluates nearby Interactable candidates
  • Selects the best valid target
  • Resolves optional activation input
  • Writes outputs such as the selected Interactable, target, interaction, normal, and distance
  • Sends a local event when a new interaction is activated

This is the main FSM entry point into the Interactables system.

Parameter Description
Interactor The Interactor to update.
Activation Mode How activation input is resolved: None, Manual, MouseButtonDown, or MouseButton.
Interact Pressed Manual activation input when Activation Mode is Manual.
Mouse Button Mouse button index used by mouse-based activation modes.
Interact Activation ID Optional activation identifier such as Use or AltUse.
Can Interact Output true when the current selection can interact this update.
Interactable Output selected Interactable.
Target GameObject Output selected target GameObject.
Interaction Output interaction name.
Activation ID Output activation ID from the selected Interactable.
Normal Output approach normal.
Distance Output measured interaction distance.
Interact Event Optional local event sent when activation succeeds.

Example

  1. Add an Interactor component to the player.
  2. Run InteractorUpdate every frame in the player FSM.
  3. Use Manual activation mode if your FSM already reads input.
  4. Store Can Interact and Interaction if you want prompts or branching logic.
  5. Handle OnInteract on the Interactable target, or react to Interact Event in the same FSM.

See also