I have an issue that seems like a clear bug to me but no idea how to solve it. In my game I have physics objects that are supposed to be paired with collision objects to make them land in different spots. As I tested I noticed that it worked well for about 10 seconds in my game and then things started to bug out with the collisions and the physics objects fell through their paired collision objects. It was not consistent though and if pausing for a bit and then creating more physics objects the collision could start to work again.
I have isolated the issue down to the issue being caused by creating any other object in a loop. Please login to see this attachment.
In my isolated example you create the physics objects by holding down the left mouse button. After the objects are created there is also a collision object created that pairs with the newly created physics objects fixed value and then an event to check for collision between them and trigger if they collide and their ID match.
This works perfectly and looks like this:
Please login to see this attachment.
Please login to see this attachment.
However.
If I then add this loop where a loop is run 200 times each frame and creates another object (that is then destroyed) everything bugs out after a few seconds (usually between 5-10 secs)and the physics objects starts to fall through their collisions. If I keep holding down the mouse they continue to fall through and sometimes they work properly again for a few seconds before falling through again.
Please login to see this attachment.
Please login to see this attachment.
Also I noticed something strange with the fixed value. The number in the top right is set to the physics objects fixed value and I noticed it seems to go negative for some reason for the "bugged" objects that fall through. Replacing the method of the fixed value with just an alterable ID value that is increased for each object produces the same results though.
I have attached the mfa example. The first frame is the bug and the second frame is with the group that runs the loop to create the object disabled and thus working.
Do anyone know why this is happening or how to fix it?
Please login to see this attachment.