So I get this error every frame:
Index p_contact_idx out of size (body->contact_count)
The engine says the culprit is the line
if state.get_contact_collider_object(i):
I do have multiple contacts reported. The amount doesn't apparently even matter. Is this an engine bug?
My version is stable. I tried with 2.1.4 too, which funnily says "Invalid ID" as first line before it starts spouting that error.
The most fun thing, though? The code definitely works. It just gives errors as a bonus.
func _integrate_forces(state):
for i in range(get_max_contacts_reported()):
if state.get_contact_collider_object(i):
if state.get_contact_collider_object(i).is_in_group("sparkobject"):
sparksposition = state.get_contact_local_pos(i)