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,

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.

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