dimforge / bevy_rapier

Official Rapier plugin for the Bevy game engine.
https://rapier.rs
Apache License 2.0
1.27k stars 259 forks source link

Make scene queries squawk when pipelines are disabled #213

Open ndarilek opened 2 years ago

ndarilek commented 2 years ago

I spent a long time debugging a situation where I'd turned off physics/query pipelines to spawn everything in a level, tried to move a system that needed the pipeline into that spawning state, and suddenly found my pipeline queries not returning objects they should have. Once I realized my mistake, the solution was obvious. But it took longer than it should have to get to that realization.

Could various QueryPipeline functions possibly log an error, panic, etc. if called when the physics pipeline is disabled? I don't think I care which they do--I just didn't remember that I'd disabled physics for legitimate reasons, and would have appreciated it if the scene queries I'd ran had at least told me they wouldn't do anything, even if only in debug builds.

Not sure if this should be in bevy_rapier or lower in the stack.

Thanks.

sebcrozet commented 2 years ago

Hi! I agree that we could add some warning. A warn log sounds appropriate here instead of a panic.

Not sure if this should be in bevy_rapier or lower in the stack.

Yes, this should be in bevy_rapier.