Skip to content

Rare intermittent issue with collisions #28

@jshaffstall

Description

@jshaffstall

The indexing by collision_type sometimes fails with a KeyError:

def handle_collision(arbiter, space, data):
    shape1 = shapes[arbiter.shapes[0].collision_type]
    shape2 = shapes[arbiter.shapes[1].collision_type]
    p = arbiter.contact_point_set.points[0].point_a

image

It looks like what's happening is that two collisions are happening in the same frame for the same object. The first collision deactivated the object, which let to the KeyError when trying to handle the second collision.

Putting a try/except in to handle the KeyError seems reasonable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions