• 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 Azzara. · Nov 15, 2011 at 11:29 PM · networkingscenerpcloadlevelsynchronization

May different clients on the network load different scenes?

I have a server and a client connected to each other like in the networking example. When the game is over the winner loads the "winning scene" and tells the loser to load the "losing scene" via RPC. At this point the server crashes.

My question is - does Unity3D assume that both instances of the game always load the same scene? I am using the LoadLevel method from the networking example.

Comment

People who like this

0 Show 2
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 syclamoth · Nov 16, 2011 at 12:12 AM 2
Share

It is technically possible to load different scenes like this, but you have to be really careful that you take care of all the networkViewIDs. Every networkView must have a corresponding networkView on every other networked computer, otherwise the errors start to pile up. It is possible, by the way, to have a networkViewID which refers to a completely different script on either side- but you have to be very careful that you name all your RPC calls properly, and serialize/deserialize your data correctly.

avatar image Azzara. · Nov 16, 2011 at 11:09 PM 0
Share

That must be the cause. I have managed to avoid the crash and see some errors get logged.

"Received state update for view id' AllocatedID: 51' but the NetworkView doesn't exist"

Apparently the "NetworkRigidbody" script of the enemy bullet that has just killed me manages to sneak one last serialization call before receiving the GameOver message. Its non-existing counterpart receives a deserialization call after the game has resumed receiving messages again. This happens when the new scene has been fully loaded... I'll figure it out, eventually.

1 Reply

· Add your reply
  • Sort: 
avatar image

Answer by DaveA · Nov 16, 2011 at 12:29 AM

It may be easier to have a 'closing scene' which can display either message, and tell each client which to show, which to hide.

Comment

People who like this

0 Show 1 · 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 Azzara. · Nov 16, 2011 at 11:21 PM 0
Share

Well, the point of having two different scenes is that there is absolutely nothing to synchronize between them. :)

I tried using a single empty scene and the problem remained. I think the removed entities cause it, not the new scene(s). Unity complains about receiving an update from the dead entities after the new scene have been loaded successfully.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Is there a way to create a shared variable between all the clients over network? 1 Answer

Buffer RPC until I have the right scene loaded 0 Answers

Question about RPCs 1 Answer

Unity Networking synchronize 3DText's 1 Answer

[Photon] Restart scene rpc doesn't work 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