TheBevyFlock / bevy_cli

A Bevy CLI tool and linter.
https://thebevyflock.github.io/bevy_cli/
Apache License 2.0
52 stars 7 forks source link

Add lint: modifying camera code under `FixedUpdate` schedule #105

Open BD103 opened 2 months ago

BD103 commented 2 months ago

See #99 for more details.

janhohenheim commented 2 months ago

Note that the correct schedule for camera update code is the last variable timestep before the fixed schedule for things that influence the physics, usually rotation, and Update for things that react to the physics, e.g. following the player.

Somewhat confusingly, the last variable update before the fixed schedules is not PreUpdate, but a specific ordering inside RunFixedMainLoop. See the fixed timestep example in the Bevy repo.

As for how to detect camera code: is it too X-Controversial to just look at the name of the involved components and see if they contain the word Camera?

alice-i-cecile commented 2 months ago

Yeah just look for Camera in the components IMO.

BD103 commented 2 months ago

As for how to detect camera code: is it too X-Controversial to just look at the name of the involved components and see if they contain the word Camera?

I'm punting it to Nursery, if that's the approach we choose. There's a lot of opportunity for false positives, and I wouldn't be comfortable stabilizing it without testing in the wild.