Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 /
This question was closed Jul 18, 2015 at 05:44 AM by meat5000 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by staddonl · Jul 17, 2015 at 09:38 AM · networkingnetworkspawnclientunity multiplayer

UNET NetworkServer.Spawn intermittently not called on clients

I'm having issues where roughly 50% of the time, a NetworkServer.Spawn() call on the server will not spawn the corresponding prefab on clients. After three 10 hours days straight of trying to resolve this issue, as well as trawling the forums for existing bug reports, I'm turning to the forums for the first time :)

  • I've verified that my ClientScene.Prefab() call is being made.

  • The object being spawned has NetworkIdentity component at its root.

  • The object being spawned has a NetworkBehaviour child script at its root.

  • I've verified that the NetworkServer.Spawn() call is being made correctly with a non-null prefab on the Server side.

  • Once the Spawn call is made on the server, nothing appears on clients and I receive the following warning on clients "Did not find target sync message for X" where X is an integer.

It's probably worth noting that I'm working in a prototype Scene of a much larger project and I'm using the build-in Unity classes (e.g NetworkManager) to obtain the initial connections.

I appreciate that code snippets would aid greatly, although the project itself is tens of thousands of lines, which would mean posting highly edited code for the sake of brevity. That could result in the editing out of the cause.

Any ideas are greatly appreciated!

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 meat5000 ♦ · Jul 17, 2015 at 09:39 AM 0
Share

You are instantiating the Objects before NetworkServer.Spawn, right?

.Prefab() isnt a listed function. Its either .Prefabs() for the Dictionary of registered prefabs or its .RegisterPrefab()

http://docs.unity3d.com/ScriptReference/Networking.ClientScene.html

avatar image n1gth · Jul 17, 2015 at 09:41 AM 0
Share

Does the Network$$anonymous$$anager have the prefab for the object being spawned added to the list of registered spawnable prefabs?

avatar image seanr · Jul 17, 2015 at 03:00 PM 0
Share

is there a scene change happening? The objects could be getting spawned on the client and deleted immediately as the scene changes.

avatar image meat5000 ♦ · Jul 17, 2015 at 03:53 PM 0
Share

Have you tested on a stable connection?

$$anonymous$$aybe refer to NetworkTransport layer to deter$$anonymous$$e Packet Loss on that particular connection?

avatar image staddonl · Jul 17, 2015 at 04:10 PM 0
Share

Hi all, thanks for your replies :) After a whole lot of tweaks and testing bits, I discovered the issue. I hadn't realised that the spawn call makes use of the standard QoS channels set on Network$$anonymous$$anager object. Switching my first channel to an assured delivery channel fixed the issue. I'll drop a summary below for anyone else that my come across this.

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by staddonl · Jul 17, 2015 at 09:04 PM

For anyone that comes across this in the future:

The NetworkServer.Spawn call makes use of the QoS channel set as '0' in your NetworkManager object. Ensure that this is set to an assured delivery channel (such as reliable sequenced) or override the channel used by the script performing the spawn call to point to an assured delivery channel.

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 xpavelos · Feb 21, 2016 at 10:29 AM 0
Share

Hi, I appreciate that you posted your solution. I am new to Unet and don't know much about networking overall, therefore I still can't solve that issue. Could you or anyone else describe in a little more detail how to change the channel?

avatar image meat5000 ♦ xpavelos · Feb 21, 2016 at 10:38 AM 0
Share

Channels should be part of Network$$anonymous$$anager

http://docs.unity3d.com/ScriptReference/Networking.Network$$anonymous$$anager.html

Networking is explained in full, here:

http://docs.unity3d.com/$$anonymous$$anual/UNet.html

Follow this Question

Answers Answers and Comments

6 People are following this question.

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

Related Questions

Since switching to using offline & online scenes in the NetworkManager, Clients will not sync (UNET) 0 Answers

How to network spawn an object from a downloaded asset bundle 0 Answers

Unity networking custom properties 0 Answers

network card game 2 Answers

Trying to store a variable for all clients 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