Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 Stradigos · Mar 28, 2012 at 06:57 PM · networkspawnservermasterserverjoin

Spawning twice upon joining server

Hello everyone,

Here's a short video showing the problem

Basically, I'm having this strange issue where the server is spawning an additional player upon joining. What's really weird is that the functions aren't being called twice, it's just spawning twice. This is apparent because there are no additional Debug.Log's are being displayed.

The code isn't that long, and it's really easy to follow. I commented the crap out of it. Since I don't like how Unity Answers shows code, here's the paste bin for it: PasteBin Code

I'm really hoping someone can point me in the right direction... Thanks in advance.

As far as the spawning code goes, it's just a simple network instantiate. I'm positive the error isn't there.

Comment
Add comment · Show 4
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 ClandestineMan · Mar 28, 2012 at 08:07 PM 0
Share

I looked through your code. There is no Initialization code in there. Also, there is no menu code as well to show us what your menu is doing.

avatar image Stradigos · Mar 28, 2012 at 09:27 PM 0
Share

The initialization code is there in startServer. You see no menu code because the buttons simply call these functions from elsewhere. The menu is based on NGUI, so there's a ton of classes there I can't post, but just know that the buttons you see in the video are calling their respective functions in that code.

avatar image ClandestineMan · Mar 28, 2012 at 09:35 PM 0
Share

That code only initializes the server... not instantiates the player/prefab.

avatar image Stradigos · Mar 28, 2012 at 10:05 PM 0
Share

The spawning code likely isn't to blame. Here are those functions though: http://pastebin.com/yj81TbvW. I'm connecting to the spawn manager and calling the SpawnEverything function, which in turn calls the appropriate spawning function.

The only way I can get this to work is by moving the SpawnEverything() call to the On$$anonymous$$asterServer.RegistrationSuceeded event. Weirdest thing ever. Every where else, including OnPlayerConnected, gives me this double spawn bullshit. And like I said, it's not calling the functions twice because none of the Debug.Log's are showing up twice (and no, collapse is NOT on in the debugger).

0 Replies

· Add your reply
  • Sort: 

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.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Networking - MasterServer [ Connect on Lan or Wan without Internet ] 3 Answers

Port not opening? 3 Answers

Network.Connect not connecting to host data or ip address 1 Answer

running 24 hours server in unity standard network 0 Answers

UNET : Custom Master server question. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges