Destroy object without triggering a rollback?

Hey there

In our game, I want to destroy a projectile prefab once it has collided with something. When I use TrueSyncManager.SyncedDestroy to destroy it, it triggers a rollback. This causes the game to stutter.

Is there any way to avoid this?


  • Hi @Prodigga, you can set rollback window to 0 to disable rollback feature.
  • Hey man

    The rollback feature is nice, it compensates for some lag and player movement is really smooth. However, when I destroy something, it triggers a rollback. So my question is is there a way to remove/disable/destroy a game object (ie when a collider hits a wall) without triggering a rollback? My understanding is that rollbacks have to happen when the predicted input is incorrect - the client has to rollback to correct. I don't understand why destroying a game object breaks this functionality.
  • Hello, I got it now what you meant. Well, the rollback happens to fix the world clones we have internally, as the body will be destroyed it needs to be correctly removed from those references. It can be improved, but it is the current implementation. You have a good point, can you try to set TSDisabled to false in the IBody (TSCollider) ?
  • Prodigga
    edited March 2017
    I will try today and let you know :)
  • Prodigga
    edited March 2017
    Doesn't seem to do anything.

    I replaced the SyncedDestroy function with this:

    public static void SyncedDestroy(GameObject gameObject) { gameObject.SetActive(false); }

    When the projectile hits the wall, it becomes disabled. (I call SyncedDestroy on the projectile). There is no rollback. This is good! Very smooth.

    But this is not good enough, I need to be able to destroy the projectile gameobject. If I keep disabling them, I will have hundreds of disabled projectiles.
  • Yeah, your are right @Prodigga, for now the logic generates a rollback as you noticed, we have created a task to better analyze this issue and find out a different approach.
  • I have been working with truesync all day together, still exploring the framework. I truly hope everything can be opensourced, because the framework is too young for it to be used seriously at this point, but I have no power to help improve the framework because I am locked out of everything. This should be really high priority! :/ Let the community help out. :)