Respawn

Respawn players around

When enabling respawn points for users you need at least one of the interaction handlers or some sort of triggers and a component RespawnController.cs. So, first, create an empty gameObject and add a component on it called RespawnController. This is enough for now. You may also define the respawn radius in case if you wish to randomly distribute the spawn points. So, your gameObject may look like this:

Then a trigger of your choice should reference the component and call method Respawn. For example in the image below, OnClickHandler is used as a trigger, so whenever user clicks on the collider with such component, it calls the method:

Similarly it may work with OnTriggerHandler or VisualScripting or BehaviorTree. See the video below to see how it works with OnClickHandler:

Last updated