A basic first-person fly camera for Bevy 0.4
There are a few notable differences from bevyflycamera...
Cargo.toml or copy lib.rs to your own file
toml
[dependencies]
bevy = "0.4"
bevy_flycam = "*"
or
toml
[dependencies]
bevy = "0.4"
bevy_flycam = { git = "https://github.com/sburris0/bevy_flycam" }
Include the PlayerPlugin
rust
use bevy_flycam::PlayerPlugin;
This will spawn a camera for you.
Use NoCameraPlayerPlugin if you do not want this and make sure to use .with(FlyCam) on your own camera or else this plugin won't know what to move.
Add the PlayerPlugin:
```rust
fn main() { App::build() .addplugins(DefaultPlugins) .addplugin(PlayerPlugin) .run(); } ```
To modify player movement speed or mouse sensitivity, import bevy_flycam::MovementSettings and add it as a resource:
```Rust
fn main() { App::build() .addplugins(DefaultPlugins) .addplugin(PlayerPlugin) .add_resources(MovementSettings { sensitivity: 0.00015 // default: 0.00012 speed; 150.0, // default: 12.0 }) .run(); } ```
PRs are very welcome.