Stumbled when googling and thought I’d add my solution to this for anyone else having the same issue.
Basically, the enter event is triggered before the exit event (both game objects have the trigger collisionObject attached).
Say I have a Ball game object that has entered into collision with Target A. There is also a Target B, and has just enough space so the Ball game object must exit Target A before it can collide with Target B.
Now say, via dragging the Ball game object away from Target A into Target B quickly will trigger the enter event first on Target B, then the exit event is triggered from Target A.
This is a problem if you want to run your logic in the order of exiting Target A, and entering Target B.
To solve this problem, in enter event, I have wrapped the game logic in a timer so it will run on the next frame. Seems to be working fine so far.
Example:
timer.delay(0, false, function(self) onDragEnd(self) end)
Any advice to this solution appreciated.