Pass ForgeDocs Product page

API

Slow motion and pause

Slow motion and hit stop, with a call that needs no reference.

PassForgeSlowMotion

Hit stops and slow motion from scripts. Slows Time.timeScale for real seconds and eases it back, with the fixed time step, so physics stays smooth. The Hit Stop and Slow Motion steps of moments use the same holds, so scripts and moments never fight over the time scale: several at once keep the slowest, and the game's own scale comes back when the last one ends. A game that pauses by setting the time scale to 0 stays paused, and paused time does not count. Allocates nothing, so it can run on every hit. Play Mode only.

public static class PassForgeSlowMotion

Namespace PassForge.Effects, assembly PassForge.Runtime.

PassForgeSlowMotion.isPlaying

True while a hit stop or slow motion holds the time scale, from a script or a moment.

public static bool isPlaying { get; }

PassForgeSlowMotion.Play(float, float, float)

Slows the game to a time scale for real seconds, then eases it back to full speed over more real seconds.

public static void Play(float timeScale, float seconds, float easeBack = 0f)

PassForgeSlowMotion.HitStop(float)

Freezes the game for real seconds, as a heavy blow lands, then snaps back to full speed.

public static void HitStop(float seconds = 0.08f)

PassForgeSlowMotion.Stop()

Ends every hit stop and slow motion at once, the ones moments play too, and gives the game its own time scale back, such as before a pause menu or a scene load.

public static void Stop()