Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rare intermittent issue with collisions #28

Open
jshaffstall opened this issue Dec 4, 2024 · 0 comments
Open

Rare intermittent issue with collisions #28

jshaffstall opened this issue Dec 4, 2024 · 0 comments

Comments

@jshaffstall
Copy link
Owner

jshaffstall commented Dec 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant