A couple of thoughts:
1. Make sure you have "reportEndContact" set to true on all your player's BodyShapes (even nested ones), otherwise contacts will stay in the list forever. Regarding the "nowhere near the player" bug, did the player EVER contact those shapes? Or is it collecting contacts that the player NEVER touched?
2. Notice that "ContactList" has a member, "contactEventFilter". when you call "forEach" or "values" it will only return contact events that pass this filter. "isEmpty" however, does not check this filter. This *may* be why the contact list seems to simultaneously have some / have no contacts.
3. Try instead of "forEach" using the "values" getter. This returns all contacts as an array (after they pass the filter). Since it's an array, you can just use "length" to see if any contact exists at all.
4. If someone could produce a small FLA that demonstrates the ContactList going bonkers that would be really helpful.
1. Make sure you have "reportEndContact" set to true on all your player's BodyShapes (even nested ones), otherwise contacts will stay in the list forever. Regarding the "nowhere near the player" bug, did the player EVER contact those shapes? Or is it collecting contacts that the player NEVER touched?
2. Notice that "ContactList" has a member, "contactEventFilter". when you call "forEach" or "values" it will only return contact events that pass this filter. "isEmpty" however, does not check this filter. This *may* be why the contact list seems to simultaneously have some / have no contacts.
3. Try instead of "forEach" using the "values" getter. This returns all contacts as an array (after they pass the filter). Since it's an array, you can just use "length" to see if any contact exists at all.
4. If someone could produce a small FLA that demonstrates the ContactList going bonkers that would be really helpful.