Author Topic: Tnet - AutoSync - MeshRenderer,MeshCollider  (Read 1795 times)

petak

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Tnet - AutoSync - MeshRenderer,MeshCollider
« 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.
« Last Edit: February 11, 2015, 11:24:57 AM by petak »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tnet - AutoSync - MeshRenderer,MeshCollider
« Reply #1 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.