Event order issue during Rollbacks

This is a quote from my network engineer.

I am not sure of the details I'm afraid:

// this lower case "isGrounded" flag is tracked and it's what we use to store weather there are any grounding colliders
// left over after the previous frame, if there is we set the "isGrounded" flag to true.
// We do this because during rollbacks we seem to get the OnSyncedCollisionEnter / OnSyncedCollisionExit messages out of order.
// By that I mean sometimes the SyncedUpdate() method will fire before the events, sometimes after.
// To make rollbacks reliable, we don't set the uppercase "Grounded" flag until the SyncedUpdate immediatly following this OnPreSyncedUpdate()

It seems that the order of collision enter/exit events is not consistent during a rollback. :(


  • Humm, it could be two things:
    1 - it just seems to be out of order, because we execute several frames in a rollback, so you have a long chain of Enter/Exit/Enter/Exit... messages, and if you get two of these messages from different frames you will see a "wrong" Exit/Enter order, did you get that?

    2 - it could be of course some bug on TS, we will note this down to check in a rollback if the order is changing, basically the code is the same but maybe it has some branch/situation that could trigger the issue.

    Thanks for reporting!