> 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/time-zone.md).

# Time Zone

A **Time Zone** is an area, defined by a `collider`, with its own [**Local Time Scale**](/magic-pig-games/magic-time-local-time-scale/local-time-scale.md). Anything passing through this zone will automatically subscribe to the Local Time Scale, and unsubscribe as they leave the zone.

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

<figure><img src="/files/VpwozsFgQexCLuzV7wFQ" alt=""><figcaption><p>The blue zone is a Time Zone!</p></figcaption></figure>

## Create a new `LocalTimeScale` at Runtime

The Time Zone is able to create its own new `LocalTimeScale` object at runtime, with a default starting value that you define.

Check the "*Create new Local Time Scale*" button to enable this, and then set the starting value you'd like.

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

## Copy an Existing `LocalTimeScale` Scriptable Object

Alternatively, you can choose to use an existing LocalTimeScale Scriptable Object which you've created in your project. At runtime, a new instance of this will be created, with the starting value defined in that object.

This is a good way to utilize `LocalTimeScale` objects with a custom derived class that you've created for your project.

<figure><img src="/files/2AwefgWTrWTgsRn0HtAb" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Even when multiple Time Zone objects use the same `LocalTimeScale` Scriptable Object, each will have its own unique instance of the object.
{% endhint %}

## TimeZone Events

There are Unity Events for `OnObjectEnter` and `OnObjectExit` which you can populate in the Inspector. These events pass a `TimeZoneEventData` objcet, which contains the `GameObject` that triggered the event, the `Collider` of that object, and the `Vector3` contactPoint.

<figure><img src="/files/dXhjwZMoIaMIeIBroL4q" alt="" width="375"><figcaption></figcaption></figure>

## Runtime Information

Viewing the Inspector at runtime will display any Subscribers currently subscribed to this objects `LocalTimeScale`.

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

You can ping the objects if you'd like to see specifically which object it is, and also remove it from the list -- useful for debugging.


---

# 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/time-zone.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.
