• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by TrivialRoo · Dec 27, 2013 at 01:44 AM · networkingbugphoton

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

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Benproductions1 · Dec 27, 2013 at 01:49 AM 0
Share

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.

avatar image TrivialRoo · Dec 27, 2013 at 11:20 PM 0
Share

Alright, I put it in the start function, but can you please help me figure out why it's spawning in multiple characters?

avatar image Benproductions1 · Dec 27, 2013 at 11:25 PM 0
Share

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.

avatar image TrivialRoo · Dec 28, 2013 at 02:35 PM 0
Share

Alright, thanks!

avatar image TrivialRoo · Jan 09, 2014 at 02:31 AM 0
Share

http://pastebin.com/trmbcSWa http://pastebin.com/uxa$$anonymous$$Exyw

1 Reply

· Add your reply
  • Sort: 
avatar image
0

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

InvalidCastException when Instantiating with photon (PUN) 2 Answers

Networking: Keep room alive without active players 0 Answers

Need help with photon and some fps kit 0 Answers

Photon Unity Player Kill Counter 2 Answers

Updating multiplayer map on joining 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges