# Infinite Saves

For this section, we will go through how infinite saves can be set up for your game by using the InfiniteSavesExample scene as a reference, which can be found in `Assets/StylishEsper/ESave/InfiniteSavesExample`.

## Prerequisites

You will need some sort of UI setup that can support infinite saves. Generally, a scroll rect is required for this case. The scroll rect will be populated with save slot buttons. There should be a button for creating a new save slot—where this is located is up to you.

## Create UI Objects

We will start by creating a UI button that will both load and overwrite data. This will be a prefab. You can make a prefab by dragging the object into the project window.

After that, create a button that will create save slots. This does not need to be a prefab. Both buttons will be children of the scroll rect's content for this example.

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

Delete the save slot button from the hierarchy, as it will be instantiated at runtime.

You will need a way to switch from loading a save to overwriting a save and vice versa. Generally, games have you navigate to a 'Load Game' section to load a game and a 'Save Game' section to overwrite a save or create a new one. For this example, we will simply be using a toggle to switch between saving and loading. Additionally, at the bottom-left, we will have a button that will delete all saves.

The data we will be saving will only be the time elapsed. So, there is a text object below the scroll rect that will display the current time elapsed.

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


---

# 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://stylishesper.gitbook.io/esave/esave-pro/scripting/save-states/infinite-saves.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.
