Prefab Instantiation

When we removed TSColliders and TSRigidbodies from our prefabs, we found that using the TrueSyncManager.SyncedInstantiate will basically cause TrueSync do destroy instantiated objects without warning.

It should probably be stated somewhere that TrueSyncManager.SyncedInstantiate is meant for the physics system and not simple TSTransforms.

Comments

  • Hello @Geminior,

    It should work by SyncedInstantiate, because there we can manage when a GameObject have to be removed on a rollback situation. We will check this issue you mention, thanks.
  • Just to elaborate on the specific situation where we encountered this problem.
    We used TrueSyncManager.SyncedInstantiate to preallocate instances in an entity pool. Some of these instances are only used locally to provide instant feedback to the local player, and they are then removed again once the actual command to e.g. place a building is received.

    What we saw was that the 'local client only' instances placed during SyncedInput were sometimes destroyed by the time the next SyncedUpdate happened.
    I hope that helps.
  • Thanks @Geminior, a tip for you if suitable is that if you have only a visual feedback or something that doesn't need to be synced of the network (smoke effect for example) you can do it without TrueSync using just GameObject.Instantiate, because it will not mess with simulation and it will increase performance of TS.