OnSyncedDestroy or OnSyncedEnd

Hi,

Is there anyway to detect OnSyncedDestroy or OnSyncedEnd or something similar to this? I needed this to properly manage rollback gameobjects.

Comments

  • Do you mean detect when a game object is removed?
  • I have this case which I spawn 1 unit inside OnSyncedUpdate() using SyncedInstantiate(). but I get OnSyncedStart() twice for spawning a single unit. One was destroyed after it was instantiate and rollback then the other one will work as usual.

    the problem here is when OnSyncedStart() I added the unit into a list which they have no problem adding in, but when i try to remove the unit from the same list under OnDestroy() it became null in the list before I call List.Remove().
  • mmediawyh
    mmediawyh
    edited March 2017
    Which makes me confuse that OnSyncedStart() if actually a real Synchronized Start. Rollback happen at least once because at the moment it SyncedStarted, it become desync at OnSyncedStart I only have StateTracker.AddTracking(this)
  • Maybe your code inside OnSyncedStart is giving this behaviour, can you pack some simple project with a repro case? I could take a better look.