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 Aevek · Aug 10, 2013 at 09:09 PM · c#networkingcrashcoroutine

Unity Editor Completely Freezing on Server Start

I can use the menu in my game to get through my server creation window, but as soon as I hit the "Start Server" button my whole editor freezes, and I have to kill it using the task manager. Because the editor completely locks up, I can't really use Debug.Logs to find where it is crashing. It worked ok before, so I'm just going to put my OnServerInitialized (which is what I changed) and what it calls in the first object.

I have structured it so that the OnServerInitialized method in my game runner object calls a method inside my Vehicle object, ActivateInput, using a BroadcastMessage. The ActivateInput method starts off my InputCoroutine in that object.

If you need to see any more code please just ask. And help would be much appreciated, I've been scratching my head on this one for a few hours now.

 public void OnServerInitialized(){
         for(int i = 0; i < playerObjects.Length; i ++)
         {
             playerObjects[i].networkView.viewID = Network.AllocateViewID();
             playerObjects[i].transform.position = offsides.position+i*Vector3.right;
         }
         
         playerObjects[0].transform.position = arenaSpawn.position;
         playerObjects[0].transform.rotation = arenaSpawn.rotation;
         camera.targetObject = playerObjects[0].transform;
         
         
         playerObjects[0].gameObject.GetComponent<Vehicle>().BroadcastMessage("ActivateInput", playerObjects[0] as NetPlayer);
         
     }
 
 public void ActivateInput(NetPlayer player)
     {
         Debug.Log("Started input co");
         this.player = player;
         StartCoroutine("InputCoroutine");
     }
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Slobdell · Aug 11, 2013 at 07:38 AM

This usually happens when you're in an infinite loop. How many player objects are there?

Comment
Add comment · Show 2 · 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
avatar image Aevek · Aug 11, 2013 at 09:50 PM 0
Share

At the time of that code, it was 4. I've changed it so now it only creates player objects as players join, but the same problem still happens. $$anonymous$$y first thought was an infinite loop too, but I have no idea where it might be.

avatar image william9518 · Aug 11, 2013 at 09:55 PM 0
Share

Can I see this input coroutine?

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

16 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

Related Questions

Multiple Cars not working 1 Answer

c# Using an IEnumerator yield WaitForSeconds to temporarily pause a While loop 3 Answers

What is way to flash the screen WITHOUT using a Texture? 2 Answers

"Strange behaviour may occur" when using Network.AllocateViewID() 0 Answers

UDP implementation in Unity, unable to send to two different machines 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