Interaction Input
The InteractionInput component is the single central nervous system for hardware input. It is responsible for polling hardware events (keyboard and mouse) and dispatching them to the interaction framework.
In this system, Interactors act purely as sensors—they do not poll for input. Instead, this global input router determines which interactor should receive commands (e.g., routing input to the Examine Panel when an item is being inspected, or falling back to the world interactor) and triggers the appropriate execution methods.
Editor Interface
Configuration Variables
Custom Input Routing
The InteractionInput component works perfectly out-of-the-box using the built-in UnityEngine.InputSystem polling. However, if your project relies on on-screen mobile UI buttons, a gamepad manager, or a heavy third-party package like Rewired, you do not need to rewrite this class.
The script exposes public Trigger methods. You can simply turn off the default polling (or leave the bindings unmapped) and call these methods directly from your own input events. The router will still handle the complex logic of determining which interactor should receive the input.
Bypassing Default Input
Route your custom interaction events directly through the Singleton instance:
public class CustomMobileInput : MonoBehaviour
{
// Called by a Unity UI Event Trigger on a mobile screen button (PointerDown)
public void OnMobileInteractButtonPressed()
{
InteractionInput.Instance.TriggerInteractPressed();
}
// Called every frame the mobile button is held down
public void OnMobileInteractButtonHeld()
{
InteractionInput.Instance.TriggerInteractHeld();
}
// Called by a Unity UI Event Trigger on a mobile screen button (PointerUp)
public void OnMobileInteractButtonReleased()
{
InteractionInput.Instance.TriggerInteractReleased();
}
}