Potential bugs with 3D collision events

Hey,

Issue 1:

OnSyncedCollisionStay is not called once per frame for a stationary TSRigidbody with gravity, touching the "ground".

1. In the "Boxes" demo, in SimpleControl.cs, add logs to OnSyncedCollisionStay and OnSyncedUpdate which include the TrueSyncManager.Ticks property. E.g.
Debug.LogWarning(owner.Id + " COLLISION STAY: " + TrueSyncManager.Ticks + ", " + other.gameObject.name); Debug.LogWarning(owner.Id + " SYNCED UPDATE: " + TrueSyncManager.Ticks + ", " + other.gameObject.name);
2. Run the demo via the lobby. Don't move. Notice issue starts after 5+ seconds.

Issue 2:

OnSyncedCollisionEnter/Exit are not called when Issue 1 occurs.

1. Add similar logs to OnSyncedCollisionEnter/Exit.
2. Run the demo via the lobby. Don't move. Notice that, while OnSyncedCollisionStay is NOT called, neither is OnSyncedCollisionExit. The state of the TrueSyncBehaviour is unknown.

Issue 3:

OnSyncedCollisionStay will sometimes trigger TWICE for one TSCollider.

1. Create a list of GameObjects in SimpleControl.cs. "m_touchingGameObjects."
2. Add every collision in OnSyncedCollisionStay to this list.
3. Clear this collision every OnSyncedUpdate. (This gives you a list of all colliders you were touching last frame).
4. Print to screen (via OnGUI) the number of entries in this list, as well as their GameObject names as aggregate.
5. Run the demo via the lobby. Don't move. Notice how it sometimes logs "2", with the SAME GameObject. I.e.

GUILayout.Box("Frame: " + TrueSyncManager.Ticks + ", owner.Id: " + owner.Id + ", collisions: " + m_touchingGameObjects.Count + " (" + m_touchingGameObjects.Aggregate("",(c,n) => c + n + ", ") + ")");

"Frame: 152, owner.id: 1, collisions: 2 ("Ground", "Ground")

Environment:

TrueSync *** Version 4.1.1.13 (2. June 2017 - rev4112)
Unity 2017.1.0b10

Best Answer

Answers