Links

Respawner

Overview

This component is in charge of Spawning the Player Animal back into the scene after he is death.
If no Player is assigned it will search for the Animal that has the Player option enabled:
It will listen to the States this animal has, and if it enters to the Death State it will Restart the 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

Reference for the Animal Player. If this parameter is empty the Respawner will find the Player Animal on the scene Using MAnimal.MainAnimal.
You can assign a Prefab here, without having an animal on the scene, this Animal Prefab will be instantiated on Start.

Respawn Point

Position to instantiate the animal. Usually is set to the same GameObject that has this component

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 death animal.

On Restart Game

Invoked when the Scene is restarted.
​
​