Godot Version
Godot 4.2.1
Question
I am making a scale for my game. I am using composition and have a component that is an Area2D that can be attached to a rigidbody, ect and the area2D surrounds the collider of that node and this makes the node weighable. Inside the weighable component script I have the weight of the object and two variables that determine whether that specific node should be weighed by the scale. One of these variables that is the subject of this question is the numTouchingConnected which is how many other weighable component area2d’s this weighable component is overlapping with. The numTouchingConnected variable gets decremented when another weighable component leaves its area and incremented when another weighable component enters the area2d.
I included an assert to check for if numTouchingConnected is negative which could cause problems and it would make no sense to ever reach a negative value. This assertion has been getting thrown occasionally during testing.
Upon further investigation with print statements, there are times when a weighable component will receive an area exited without ever receiving an area entered from that same weighable component as shown here, 28 never gets entered by rigidbody 29’s weighable component area2d:
I have a bandaid fix in mind by keeping a hashmaps of the currently touching node ids but I wanna know why this is happening if anyone has an idea