- Home /
Photon network creates multiple players on death?
I'm using Photon Network and I am experiencing a small bug. Sometimes, happens mostly with players that are NOt the MasterClient, when the player dies, they get stuck on the Spawn gui part and if they keep clicking 'Spawn', they will just generate more and more instances of the player.
All of my code is on pastebin. Please take a look and help me!
Health/Death script: http://pastebin.com/uxaMExyw
NetworkManager(respawn gui): http://pastebin.com/trmbcSWa
Just to put it out there, you should never ever use Find
anything at any point other than when the scene is loaded (but even then it's unnecessary). It's probably the slowest function in the entire game engine once you have a decent amount of objects in the scene, except for Broadcast$$anonymous$$essage
.
Alright, I put it in the start function, but can you please help me figure out why it's spawning in multiple characters?
You haven't posted enough code to be able to fix your problem. If it's a lot, use pastebin. On the other hand, you could try solving the problem yourself. Use Debug.Log
and try to narrow down the problem.
Answer by graham30 · Dec 29, 2019 at 07:20 PM
I have the same issue, when my player dies, a new player is standing there . . it's like the players soul left his body lol