logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class ScreenShakeChannel

    Feedback channel that produces camera positional shake via a decaying jitter coroutine. Handles ScreenShakeEffect. When the target names a joined player and GetPlayerAssignments() has an assignment for it, only that player's camera shakes; when the target is global and split-screen assignments exist, every assigned camera shakes together; otherwise the channel falls back to GetActiveCamera(), which already falls back to UnityEngine.Camera.main when nothing else is registered/selected — call SetActiveCameraOverride(object) to pin a custom rig instead of a plain "MainCamera" tag. The offset is applied through a UnityCameraShakeApplier (added to each camera automatically) so it survives a camera controller that sets the camera's position every frame. Uses unscaled time so it survives a hit-stop. UI shake lives in its own channel (UiScreenShakeChannel).

    Inheritance
    object
    ScreenShakeChannel
    Implements
    IFeedbackChannel
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Feedback.Infrastructure.Channels
    Assembly: Serenity.UnityFeedback.Infrastructure.dll
    Syntax
    public class ScreenShakeChannel : IFeedbackChannel

    Constructors

    ScreenShakeChannel(IFeedbackRuntime, IGameCameraService)

    Initializes a new ScreenShakeChannel.

    Declaration
    public ScreenShakeChannel(IFeedbackRuntime runtime, IGameCameraService gameCameraService)
    Parameters
    Type Name Description
    IFeedbackRuntime runtime

    Coroutine host used to run and cancel the shake decay routine.

    IGameCameraService gameCameraService

    Resolves the camera(s) to shake (active-camera selection, override pin, and split-screen assignments).

    Properties

    ChannelId

    Declaration
    public string ChannelId { get; }
    Property Value
    Type Description
    string

    Methods

    CanPlay(IFeedbackEffect)

    Declaration
    public bool CanPlay(IFeedbackEffect effect)
    Parameters
    Type Name Description
    IFeedbackEffect effect
    Returns
    Type Description
    bool

    Play(FeedbackTarget, IFeedbackEffect)

    Declaration
    public void Play(FeedbackTarget target, IFeedbackEffect effect)
    Parameters
    Type Name Description
    FeedbackTarget target
    IFeedbackEffect effect

    Stop(FeedbackTarget)

    Declaration
    public void Stop(FeedbackTarget target)
    Parameters
    Type Name Description
    FeedbackTarget target

    StopAll()

    Declaration
    public void StopAll()

    Implements

    IFeedbackChannel
    In this article
    © 2026 Serenity. All Rights Reserved