🚩Respawner
Last updated
Last updated
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 character has, and if the character activates 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.
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.
Position to instantiate the animal. Usually is set to the same GameObject that has this component
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.
Time needed to restart the game or respawn the animal, after the animal died.
If the Player is a Prefab. It will leave behind the Death Animal mesh. Set true this parameter to remove the dead character.
Invoked when the Scene is restarted.