Hi Felgo,
Like in the title, question: when you use CircleCollider, should you set width
and height
despite that radius
specify dimensions of the collider?
I ask because I managed to hit case when not settings this cost me 1-2 days of work to figure weird behavior 🙂
I don’t want to go into details too much, it was some rather complex scenario where one dynamic body is “inside” another dynamic body while both are moving and also the scene is moving.
The problem was that in this situation, colliders were constantly firing fixture events in loop(beginContact, changeContact, finishContact).
Even if the smaller body was all the time inside the bigger one, never leaving it.
Once I set explicitly width and height to CircleCollider, boom, problem solved.
Suddenly no fake events are triggered apart from contactChanged, no more contactFinished and contactStarted every frame.
What also changed is that in the debugDrawVisible: true
mode, the square lines around collider, stopped changing height all the time, when scene was moving.
I am curious, if am I just completely wrong here or there can be a difference when you set width and height in CircleCollider.
Maybe it shouldn’t matter in the end?