How to spawn different character on die (respawn)?

Nikot93

New member
hi,

when my player is dead, i want to spawn a different character prefab. How i can do that?
Any suggestions please?
 

Justin

Administrator
Staff member
With PUN it's going to be more difficult so I would first get it working with a single player game. You can do that by subscribing to the OnRespawn event and spawning a new prefab. With PUN you'll need to do that an then also transfer ownership to the new character from your local client.
 

Nikot93

New member
With PUN it's going to be more difficult so I would first get it working with a single player game. You can do that by subscribing to the OnRespawn event and spawning a new prefab. With PUN you'll need to do that an then also transfer ownership to the new character from your local client.

If instead of using the subscription to the respawn event, I set a gameobject that must be instantiated after death, could it be a good solution?

Like this:
Spawn on death.PNG
 

Justin

Administrator
Staff member
That'll spawn the object, but you'll still need to transfer ownership within PUN.
 

Vlaxep

Member
@Nikot93 have you achieved this yet?

Thinking this could work for my game too.... I need players to be able to choose different 'classes' to spawn as.
 
Top