Table of Contents

Example - Pause Player Input

You want to take the camera away from the player for a moment (a cutscene, a tutorial pop-up, a forced framing during a story beat), without them fighting your animation by dragging or scrolling.

SetInputEnabled(bool) on the OrbitalCameraSystem enables or disables every InputAdapter in the camera's children in one call: mouse, keyboard, touch, UI buttons, and the New Input System adapter if you're using it. The public-API animation methods keep working, so your scripted camera moves run uninterrupted.

using UnityEngine;
using Goehler.OrbitalCam;

public class CameraInputGate : MonoBehaviour {

    [SerializeField] private OrbitalCameraSystem _camera;

    public void Pause() => _camera.SetInputEnabled(false);
    public void Resume() => _camera.SetInputEnabled(true);
}

Call Pause() before your cutscene starts, Resume() when it ends.

Note

SetInputEnabled is the broad option. It flips every input source at once. For finer control (fx. suppress drag-to-pan but still allow zoom), use the individual adapter components on the camera's children and toggle their enabled flag, or their axis-specific bools directly: legacyMouse.UseMouseForMovement = false, legacyTouch.UseTouchPinchForZoom = false, etc.

This pattern is wired up in the Scripting Demo scene. Hit Play, click the Toggle Input button, then try to drag, scroll, or zoom: the OrbitalCam ignores everything until you click the button again.

This works well with the Cinematic example: gate input off, run the camera animation sequence, gate input back on at the end.