> For the complete documentation index, see [llms.txt](https://infinitypbr.gitbook.io/magic-pig-games/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infinitypbr.gitbook.io/magic-pig-games/juicy-actions/clock-and-time-scales/magic-time-integration.md).

# Magic Time Integration

v1.0

The **Magic Time** bridge is a built-in adapter that lets **Juicy Actions** (actions, executors) respect *local time scaling* by hooking into the [***Magic Time***](broken://pages/hlYGqP9mEYDbmgzVLrzB) module. If your game already uses Magic Time (or wants to), the bridge ensures that all actions operate under that local-time clock, rather than the Juicy Action timescale.

## Quick Start: Integrate Magic Time

### 1. Extract Magic Time Integration & Import Magic Time

Import **Magic Time** from Package Manager. Then, extract the bridge file in `MagicTimeIntegration.unitypackage`.&#x20;

### 2. Add `MagicTimeUser` or `IUseLocalTime`

Any `GameObject` (or component) that should influence time-based actions must have a component implementing `IUseLocalTime`. The simplest is the provided `MagicTimeUser` (or a subclass), or you can roll your own class that implements `IUseLocalTime`.

The most basic format is to add the `MagicTimeUser` component to your object. Then, assign the Magic Time timescales that you want to affect this object. The `ActionExecutor` will find this component, and utilize its timescale values.

### 3. Press Play

3. Press Play — the bridge registers automatically, and all Actions will now follow your local Magic Time scale.

## Detailed Description of Operations

`MagicTimeClockResolver` is the bridge class that is used to connect **Magic Time** with **Juicy Actions**. The bridge  implements IClockResolver.

When loaded, it registers itself automatically:

```csharp
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
private static void Install() => ActionClock.Register(new MagicTimeClockResolver());
```

Then, whenever an `ActionExecutor` requests a clock:

1. The executor calls all registered resolvers in priority order.
2. `MagicTimeClockResolver` looks for `IHaveLocalTime` on the target or its parents.
3. If found, it wraps that component inside a `MagicTimeObjectClock`, which adapts Magic Time’s interface to Juicy Actions `IClock`.
4. The executor uses that clock for all delta- and wait-based operations.

{% content-ref url="/pages/OQ0THcimYG0nnul1YiUo" %}
[Custom Time Bridge / Integrations](/magic-pig-games/juicy-actions/clock-and-time-scales/custom-time-bridge-integrations.md)
{% endcontent-ref %}
