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 /
avatar image
1
Question by 16bitjack · Jul 12, 2015 at 11:37 AM · networkingmultiplayerunity multiplayer

Why does anything instantiated over the network by a client disappear when that client disconnects?

Hi there,

I'm trying to get my head round the new networking system in V5.1.1f1+ for a project I want to do and so i'm doing some smaller projects to be able to get some understanding before jumping right in the deep end.

Basically I was wondering why anything that is created in game by effect of a client disappears when that client disconnects?

For example I'm trying to make a simple instant messaging system which ive got working exactly how I wanted it to, the only issue is when the client that sent the messages disconnects, there messages disappear, the messages are displayed on screen by a UI prefab that is instantiated with all of the text of that prefab being setup when first spawned.

Is there some sort of setting somewhere to turn on spawned prefabs not disappearing on disconnect?

I'm really struggling to find good tutorials on the new networking solution,

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by meat5000 · Jul 12, 2015 at 11:52 AM

You need to have the client instruct the server to activate all objects and SyncVar the text.

If an object is owned by a client it exists on all machines but if the client disconnects, destroying all its own objects, this is what syncs to the server.

The basic tutorials are actually pretty good.

https://www.youtube.com/watch?v=NLnzlwCRjgc

The networking basics are the same for all operations. The difficulty comes in deciding what the server and client should do to minimise bandwidth but maximise experience.

Comment
Add comment · 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
0

Answer by seanr · Jul 15, 2015 at 01:44 PM

the IM messages themselves are spawned?

well, you could make the spawned objects create the actual IM messages in the UI instead of "being" them, then they would persist after disconnect.

or, you could implement custom spawn handling functions.

http://forum.unity3d.com/threads/controlling-the-spawn-behaviour-object-pooling.329902/#post-2140231

Comment
Add comment · 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 16bitjack · Jul 15, 2015 at 03:35 PM 0
Share

I realized what was occurring that the message ui were only spawning on the client and not on the host, I didn't have any sort of camera system set up so when a client joined there UI would just spawn on top of the hosts and display the messages which looked as if it was working however when that client disconnected there UI would despawn and remove all the messages because they were never being spawned into the host's UI :)

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

Unity networking tutorial? 6 Answers

uNet Offline and Online Scenes the Same 2 Answers

How to send large messages through UNET 0 Answers

uNet Connection to IPv6 [Networking] 0 Answers

How to test single scenes with UNET? 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