• 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
Question by drex150 · Sep 21, 2015 at 09:34 AM · networkingmultiplayernetworkonlinedisconnect

Multiplayer Game Disconnects

Sorry about t$$anonymous$$s long post, I thought I would explain everyt$$anonymous$$ng as best I could.

I am making a basic multiplayer game mostly just to learn the new multiplayer tools in Unity 5. I have 2 scenes. The first scene has just an empty game object with the Network Manager and Network Manager HUD attached to it. There is a second scene where the player spawns in when they get connected to the network. T$$anonymous$$s error only occurs when the Network Manager has Network Simulation checked. I have it set to 75 MS so it should only $$anonymous$$t about 150 ping or so. Here is a picture of my Network Manager's settings:

alt text

The player is the built in Rigidbody FPS Controller. He has a Network Identify attached with Local Player Authority attached to $$anonymous$$m. He also has a script I made myself that is very basic. It simply turns on $$anonymous$$s Rigidbody First Person Controller script and turns on $$anonymous$$s camera if it is the local player. Here is the script:

 using UnityEngine;
 using System.Collections;
 using UnityEngine.Networking;
 using UnityEngine.UI;
 
 public class multiplayerActivate : NetworkBehaviour {
 
     [SerializeField]GameObject playerCam;
 
     private NetworkClient nClient;
     private int latency;
     private Text latencyText;
     // Use t$$anonymous$$s for initialization
 
 
     void Start ()
     {
         nClient = GameObject.Find("networkManager").GetComponent<NetworkManager>().client;
         latencyText = GameObject.Find("Ping").GetComponent<Text>();
         if (isLocalPlayer)
         {
             playerCam.SetActive(true);
             GetComponent<UnityStandardAssets.Characters.FirstPerson.RigidbodyFirstPersonController>().enabled = true;
         }
     }
     
     // Update is called once per frame
     void Update ()
     {
         ShowLatency();
     }
 
     void ShowLatency()
     {
         if (isLocalPlayer)
         {
             latency = nClient.GetRTT();
             latencyText.text = latency.ToString();
         }
     }
 }
 

When I build and run I get no errors. I then use the stand alone client to be the host w$$anonymous$$le the editor is the client. Both players spawn in but the editor player's lighting is completely different. The light color is much darker. After about 20 seconds of running around as the host, the client (the editor) disconnects and I get the following 2 errors:

 aissp: time {1839778} lastRecTime {1837343} DisTme {2000}, rtt {69} 

 UNet Client Disconnect Error: Timeout
 UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()

And the following warning error:

 Multiple NetworkManagers detected in the scene. Only one NetworkManager can exist at a time. The duplicate NetworkManager will not be used.
 UnityEngine.Networking.NetworkManager:Awake()


There is not more than one NetworkManager. I also get t$$anonymous$$s warning even if I just play from the editor without the stand alone client.

Also, the disconnect doesn't seem to happen if I set the network simulation ping below 50 or if I turn it off entirely. It runs just fine then but I still get the more than one NetworkManager error no matter what. I also added a ping script that basically just shows the ping of the client, and it never gets close to the 500 ping timeout setting. It only $$anonymous$$ts about 150-180 max.

That's all the info I can t$$anonymous$$nk of. Do you guys have any ideas?

networkmanagerpic.png (107.2 kB)
Comment

People who like this

0 Show 0
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

Answer by ManjiDM · Nov 09, 2015 at 11:13 AM

@drex150 I also have the same problem regarding the network manager and don't know the answer to that problem. For the lighting problem you should select the "levelTest" scene and then in "Window->Lighting->Scene" there's an "Auto" checkbox in the bottom that in your case is probably checked. You should uncheck it and then press the "Build" button to the right. After some processing it should bake lightmaps and solve your problem. Hopefully it will work as it did for me :)

Comment

People who like this

0 Show 0 · 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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

33 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 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

How can I create a simple chat system for my multiplayer game? 1 Answer

How to use an RPC to send an animation over the network? 2 Answers

Unity networking tutorial? 6 Answers

Testing my multiplayer character offline 0 Answers

Photon variable synchronization 1 Answer


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