How it works
Unity has one time scale for the whole game, Time.timeScale. Magic Time adds local time on top of it, built from four parts:
- Local Time Scale: a ScriptableObject that holds one value (1 is normal, 0.5 is half speed, 0 is frozen, 2 is double). Create assets such as Global or Enemies and change them at runtime with
SetValue, Pause and Resume.
- Magic Time Manager: add one to your scene. It makes runtime copies of the scale assets you list, so the assets themselves never change, and hands them out by name.
- Magic Time User: a MonoBehaviour that gives an object local time. Each User has its own scale and can subscribe to any number of shared ones. The combined scale is their product, so an object at 0.5 that subscribes to a 0.5 scale runs at 0.25. When that value changes, the User eases to it over its transition duration and curve.
- Time Zone: a component for a trigger collider (3D or 2D). Magic Time Users that enter are subscribed to the zone’s scale, which stacks with their other scales, and unsubscribed when they leave.
Four more components read a User’s time scale every frame and match Audio Source pitch, an Audio Mixer pitch parameter, Particle Systems and Trail Renderers to it.
Making your scripts use local time
Magic Time changes the numbers; your code has to read them. Wherever an object on local time uses Time.deltaTime, use its User’s DeltaTime instead. FixedDeltaTime, Time and TimeScale work the same way. They are properties of each User (for example enemy.DeltaTime), not static values.
There are two ways to connect a script:
- Inherit
MagicTimeUser instead of MonoBehaviour. If you override Awake, OnEnable, Update, OnDisable or OnDestroy, call the base method, or the object’s clock and transitions stop.
- Add a
MagicTimeUser component and read DeltaTime from it. Use this when your class already inherits from something else.
To slow a whole group at once, change a shared scale, for example MagicTimeManager.Instance.TimeScale("Enemies").SetValue(0.2f). Every subscriber follows.
Animators, NavMesh agents, coroutines and Rigidbodies still run on Unity’s global time, so connect them yourself: set animator.speed from TimeScale, and count up local DeltaTime instead of using WaitForSeconds. The scripting documentation covers the full API.
Set it up with an AI assistant
Magic Time includes AI skills for Claude Code, Codex and other coding assistants. For Claude Code or Cowork, run the bundled script in your project:
bash "Assets/Magic Pig Games (Infinity PBR)/Magic Time/Claude Skill/install.sh"
For Codex, copy the magic-time folder from that Claude Skill folder into .agents/skills in your project.
Ask “What can you do with Magic Time?” to check that it’s active, then describe what you want in plain English. With Unity’s MCP bridge running, the assistant adds the manager, creates scales, makes objects Users and builds Time Zones in the open editor. Without the bridge, it writes the C# and an editor menu item you click to build the setup.