Closed Alainx277 closed 2 years ago
I ran into this as well. It only seemed to happen when I was despawning an entity with both collider and rigid body components.
I ran into this as well. It only seemed to happen when I was despawning an entity with both collider and rigid body components.
My entities also have both.
I wasn’t able to reproduce the bug based on our despawn examples, but I think that @Alainx277’s suggestion to check if the entity exists is the right solution. Could you please test the despawn-fix branch to see if it works for you?
@sebcrozet same error. You patch works.
Yes, fixes the panic for me.
Already reported in on Discord, but this fixes it for me as well. Thanks!
Thank you all for checking!
Despawning an entity with a rigidbody causes the following panic:
thread 'main' panicked at 'Attempting to create an EntityCommands for entity 570v0, which doesn't exist.', C:\Users\USER\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_rapier3d-0.12.0\src\physics\resources.rs:240:26
I think the easiest fix would be to check if the entity still exists, and only remove the components if that is the case.