Tasharen Entertainment Forum

Support => TNet 3 Support => Topic started by: petak on February 11, 2015, 06:05:54 AM

Title: Tnet - AutoSync - MeshRenderer,MeshCollider
Post by: petak on February 11, 2015, 06:05:54 AM
Hello everybody,

I would like to ask, if is possible sync via TNet MeshRenderer or MeshCollider. I tried the component AutoSync and choose paramatr MeshCollider.mesh and MeshRenderer.material for first test. There is one little problem the MeshRenderer is procedural generated in gameplay, and I would like to sync to all players.

Is this possible via Tnet ? When I try it I get some errors about seralization...
     UnityEngine.Debug:LogError(Object)  TNet.Serialization:ReadObject(BinaryReader, Object, Int32, Type, Boolean) (at Assets/TNet/Client/TNSerializer.cs:1419)
(and the texture is pink withnout collider)

When I tried MeshCollider.sharedMesh MeshRenderer.sharedMatrial there is no error but nothing change.

Thank you for any tips or advice.
Title: Re: Tnet - AutoSync - MeshRenderer,MeshCollider
Post by: ArenMook on February 11, 2015, 09:56:50 PM
No, you can't sync references to renderers or colliders -- or any references for that matter.

If you want to sync something like that you will want to sync the actual data -- like the vertices of the mesh -- and you will want to write your own script for that instead of using Autosync.