# Magic Time Manager

Create an empty object, perhaps named "Magic Time Manager", and add the `MagicTimeManager` component onto it. This holds [`LocalTimeScale`](/magic-pig-games/magic-time-local-time-scale/local-time-scale.md) instances which can be accessed by any [`IUseMagicTime`](/magic-pig-games/magic-time-local-time-scale/magic-time-user/ihavelocaltime.md) (or [`MagicTimeUser`](/magic-pig-games/magic-time-local-time-scale/magic-time-user.md)) object.

<figure><img src="/files/xOLu6qcPTnPDT0kuRXpr" alt=""><figcaption></figcaption></figure>

## Initial Time Scales

Populate this list with Local Time Scale Scriptable Objects you've created. Each will be replaced with a new instance of those objects, to keep from overwriting the default values on the Scriptable Objects.

## In Game TimeScales

At runtime, information about each `LocalTimeScale` will be shown here, including the current value and the number of subscribers.

<figure><img src="/files/m4H0QgLbVIBDfTVkyzu5" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Other objects which inherit from [`MagicTimeUser`](/magic-pig-games/magic-time-local-time-scale/magic-time-user.md) or implement [`IUseMagicTime`](/magic-pig-games/magic-time-local-time-scale/magic-time-user/ihavelocaltime.md) can "Subscribe to Initial TimeScales". When this happens, they subscribe to the instance assigned to the **Magic Time Manager**.

This way, all objects will be following the same instance, and share the same information.
{% endhint %}

## All Time Scales

This `List<LocalTimeScale>` is populated automatically when you view the **Magic Time Manager** in the Inspector. It contains all of the Scriptable Objects in the project, so you can easily find them.&#x20;

This is also used when the `TimeScale()` method is called -- if the `LocalTimeScale` has not been instanced yet, then the script will look it up in this list, before trying to create a new `LocalTimeScale` object.

## Additional Scripting

Don't forget to check out the [**Magic Time Manager Scripting**](/magic-pig-games/magic-time-local-time-scale/magic-time-manager/magic-time-manager-scripting.md) page for more information on what you can do with this class.

{% content-ref url="/pages/h47ese9W6c7usRvA83Sm" %}
[Magic Time Manager Scripting](/magic-pig-games/magic-time-local-time-scale/magic-time-manager/magic-time-manager-scripting.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://infinitypbr.gitbook.io/magic-pig-games/magic-time-local-time-scale/magic-time-manager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
