> 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 %}
