> 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/magic-time-local-time-scale/overview.md).

# Overview

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

**Magic Time -** **Local Time Scale** is a powerful tool bringing independent and stackable time scale behaviors to your project.

Each [**Magic Time User**](/magic-pig-games/magic-time-local-time-scale/magic-time-user.md) has its own [**Local Time Scale**](/magic-pig-games/magic-time-local-time-scale/local-time-scale.md) and can subscribe to any number of additional Local Time Scales, combining their effects. For example, most projects will likely have a "Global" Local Time Scale object.

In the GIF below, the projectile and characters are passing through a [**Time Zone**](/magic-pig-games/magic-time-local-time-scale/time-zone.md) which automatically subscribes objects to its own LocalTimeZone, so they are affected by it.

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

## Easy to Use

For each class that you want to have a Local Time Scale, inherit that from [`MagicTimeUser`](/magic-pig-games/magic-time-local-time-scale/magic-time-user.md) (a `MonoBehaviour`).

Then, whereever you'd call `Time.deltaTime` or similar `Time` values, call the `DeltaTime` (or similar) from your class instead! The object is now able to be controlled with **Magic Time**.

Here's a simple example of how you might use this in your code.

```csharp
// Old Way: Time.deltaTime
var timeSinceLastFrame = Time.deltaTime;

// New Magic Time deltaTime
var timeSinceLastFrame = MagicTimeUser.DeltaTime;
```

{% content-ref url="/pages/Jou6qefxuSANFUTQQmTo" %}
[Quick Start](/magic-pig-games/magic-time-local-time-scale/quick-start.md)
{% endcontent-ref %}

{% content-ref url="/pages/nDaJ0nzRUkX0U2P9IGKA" %}
[FAQ](/magic-pig-games/magic-time-local-time-scale/faq.md)
{% endcontent-ref %}

## Integrations

Magic Time integrations seamlessly with [**Projectile Factory**](broken://pages/9DRf9z50Dep5PcIz0NZD) and [**Game Modules**](broken://pages/-MY8JopC2EjmWaXKwSh7)!

{% content-ref url="/pages/iZsGJaJ9jGwzAI8Fpizv" %}
[Magic Time for Projectile Factory](/magic-pig-games/projectile-factory/magic-time-for-projectile-factory.md)
{% endcontent-ref %}

{% content-ref url="/pages/EHbSHDQF3bpBn0vBAoU4" %}
[Magic Time for Game Modules](/magic-pig-games/game-modules-4/magic-time-for-game-modules.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
