Crates.io | bevy-fpscam |
lib.rs | bevy-fpscam |
version | 0.7.0 |
source | src |
created_at | 2022-06-06 18:38:30.483428 |
updated_at | 2022-06-06 18:38:30.483428 |
description | A basic fps-style camera for bevy |
homepage | |
repository | https://github.com/u296/bevy-fpscam |
max_upload_size | |
id | 600906 |
size | 11,005 |
A basic fps-style flycamera for bevy
The controls are customizable
[dependencies]
bevy = "X.Y"
bevy-fpscam = "X.Y"
use bevy_fpscam::FpsCamPlugin;
This will spawn the camera for you. If you want to create
the camera yourself, use NoSpawnFpsCamPlugin
instead, and
add a FpsCam
component to your camera.
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(FpsCamPlugin)
.run();
}
You can modify mouse sensitivity, movement speed and keybindings
by modifying the resource of type bevy_fpscam::Config
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(FpsCamPlugin)
.insert_resource(bevy_fpscam::Config{
movespeed: 2.0,
sensitivity: 0.01,
key_bindings: KeyBindings {
unlock: Some(KeyCode::Enter),
..Default::default()
}}).run();
}