Join the Discord

Unity tools by Magic Pig Games

Magic Time

Give any object its own time scale: slow it, speed it up or freeze it.

Magic Time is a Unity asset by Magic Pig Games that gives each object its own local time scale instead of one global Time.timeScale. Slow one enemy while the player runs at normal speed, freeze a group, add bullet time or build slow-motion zones.

Version 1.1.2 · updated September 21, 2026 · Unity 6.0 or newer

What Magic Time does

  • A time scale for every object

    Each Magic Time User has its own local time scale: 1 is normal speed, 0.5 is half speed, 0 is frozen and 2 is double. Slow one enemy and nothing else in the scene changes.

  • Shared scales that stack

    Create Local Time Scale assets such as Global, Enemies or Projectiles and subscribe objects to as many as you like. Values multiply, so two 0.5 scales give 0.25, and one change updates every subscriber.

  • Slow, fast and frozen Time Zones

    Put a Time Zone on a trigger collider to make an area slow, fast or frozen. Magic Time Users that enter take on the zone's scale and drop it when they leave, and enter and exit events tell you who crossed.

  • Smooth ramps or instant snaps

    When an object's combined scale changes, it eases to the new speed over a transition duration and AnimationCurve you set per object. Set the duration to 0 for instant changes.

  • Audio, particles and trails follow

    Drop-on components keep Audio Source and Audio Mixer pitch, Particle Systems and Trail Renderers in step with an object's local time, with no extra code.

  • Events when time changes

    Every Local Time Scale raises C# events and UnityEvents when its value changes, when it pauses or resumes, and when objects subscribe or leave. Use them to drive UI, sound or gameplay.

  • Works with other Magic Pig tools

    Integrations let Juicy Actions, Projectile Factory projectiles and the Game Modules 4 game clock follow Magic Time scales.

  • AI skills for coding assistants

    Bundled skills let Claude Code, Codex and other AI coding assistants set up Magic Time, build Time Zones and write local-time code for you, with or without Unity's MCP bridge.

Works with AI coding assistants

Magic Time comes with skills for AI coding assistants such as Claude Code and Codex. Once they're installed, your assistant knows how Magic Timeworks, so you can ask for what you want in plain English:

  • “Set up Magic Time and make this enemy move in slow motion while the player stays normal.”
  • “Add a slow-mo bubble the player can walk through that doesn't slow the player.”
  • “Make my custom movement script obey local time so it slows in time zones.”
  • “Add a bullet-time toggle that ramps the world to 0.2× and smoothly back.”
  • “Make this enemy's audio, particles and trails slow down with it.”

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.

Questions about Magic Time

How is Magic Time different from Time.timeScale?

Time.timeScale changes the speed of the whole game at once. Magic Time gives each object its own local time scale, so you can slow one enemy, freeze a group or speed up an area while everything else runs normally. A Magic Time User's DeltaTime is Unity's Time.deltaTime multiplied by that object's combined scale.

Will my existing scripts slow down automatically?

No. Magic Time changes the values your code reads, so movement, timers and cooldowns must use the object's DeltaTime instead of Time.deltaTime. Inherit from MagicTimeUser, or add a MagicTimeUser component and read DeltaTime from it.

Can I slow down enemies but not the player?

Yes. Make the enemies Magic Time Users and lower their scale, or a shared Enemies scale, while the player stays a plain object on normal time. Time Zones also skip objects that aren't Magic Time Users, and a player that is one can be kept out with physics layers or a TimeZone subclass that checks its tag.

How do I make an area where time slows down?

Add a trigger collider and a TimeZone component, then set its time scale value, for example 0.3 for 30% speed. Magic Time Users slow down when they enter, stacking with their other scales, and return to normal when they leave.

Does Magic Time slow Animators, physics and coroutines?

Not on its own, because they run on Unity's global time. Set animator.speed from the object's TimeScale, count local DeltaTime instead of using WaitForSeconds, and use FixedDeltaTime for kinematic movement you step yourself. Dynamic Rigidbodies have no per-object clock, so slowing them means scaling their velocity or forces, which is an approximation.

Does Magic Time work with Juicy Actions, Projectile Factory and Game Modules 4?

Yes, each has a Magic Time integration. Juicy Actions on a Magic Time User run on its local time and can animate Local Time Scales and Time Zones, Projectile Factory projectiles become Magic Time Users with the MagicTimeProjectile component, and Game Modules 4's TimeboardMagicTimeUser scales game time by Magic Time scales.

Can an AI assistant set up Magic Time for me?

Yes. Magic Time includes AI skills for Claude Code, Codex and other coding assistants, installed with the bundled install.sh (for Codex, copy the skill folder into .agents/skills instead). With Unity's MCP bridge running, the assistant builds the manager, scales, Users and Time Zones in your open project; without it, it writes the scripts and an editor menu item you click.