> For the complete documentation index, see [llms.txt](https://malbersanimations.gitbook.io/animal-controller/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malbersanimations.gitbook.io/animal-controller/secondary-components/respawner.md).

# Respawner

Last updated AC v1.5.3

## Overview

This component is in charge of Spawning the Player Animal back into the scene after he is death.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FIbRvH9wTUnaHR0KjPDeG%2Fimage.png?alt=media&#x26;token=ea04e9da-a440-4731-95f3-1cecf1386509" alt=""><figcaption></figcaption></figure>

If no Player is assigned it will search the scene for a character that carries the **Player** Malbers Tag (see **Player Tag** below).

{% hint style="info" %}
**AC v1.5.3:** the Animal's *Player* toggle was removed. The Respawner and the [**CheckPoints**](/animal-controller/secondary-components/checkpoint.md) recognize the Player only through the Player Tag: add a [**Tags**](/animal-controller/scriptable-architecture/scriptables/tags.md) component with the `Player` Tag to your character (the Tags component has a *Set Player Tag* context menu).
{% endhint %}

It will listen to the States this character has, and if the character activates **Death** State it will respawn it (or restart the scene, see **Restart Scene**).

If the Player parameter set is a Prefab it will instantiate it on the Respawn point.

This component works along with the CheckPoint component. If an animal enters a checkpoint the Respawner will move to that Checkpoint position and it will store the last State the animal use on that checkpoint.

## Parameters

### Player

Player to Respawn. It can be a Prefab (a new one is instantiated on each respawn) or a Scene GameObject (the same one is reset). Leave it empty to find the Player on the scene using the **Player Tag**.

### Player Tag

Malbers Tag used to recognize the Player on the scene when no Player is assigned. Defaults to the `Player` Tag asset. The Tags component can be on the character root or on one of its children.

### Respawn State

State on which the Animal will be respawned. This value by default is Idle. When an animal interacts with a **CheckPoint**, the Last State that the animal had before entering the checkpoint.

### Respawn Time

Time needed to restart the game or respawn the animal, after the animal died.

### Destroy After Respawn

If the Player is a Prefab. It will leave behind the Death Animal mesh. Set true this parameter to remove the dead character.

### Dont Destroy On Load

The Respawner is kept between scenes. When a Respawner already survived from a previous scene, a new one in the loaded scene disables itself.

### Restart Scene

Reloads the active scene after the Respawn Time instead of resetting the character in place. Use it for Scene characters that cannot be reused after dying (e.g. a Ragdoll Death with *Destroy Animal* enabled).

### On Respawned

Invoked with the Player GameObject every time it is placed on the Respawn Point (previously named *On Restart Game*).

{% hint style="warning" %}
The Respawn Point is the Transform of the GameObject holding this component. CheckPoints move it.
{% endhint %}
