Inspired from Source engine movement, this plugin implements movement suitable for FPS games.
⚠️ Feedback requested! Still in early stages, feel free to make issues/PRs
See main.rs
bash
cargo run --example minimal
```rust use bevy::prelude::; use bevy_rapier3d::prelude::;
use bevyfpscontroller::controller::*;
fn main() {
App::new()
...
.addplugin(RapierPhysicsPlugin::
fn setup(...) { ... commands.spawn(( Collider::capsule(Vec3::Y * 0.5, Vec3::Y * 1.5, 0.5), ActiveEvents::COLLISIONEVENTS, Velocity::zero(), RigidBody::Dynamic, Sleeping::disabled(), LockedAxes::ROTATIONLOCKED, AdditionalMassProperties::Mass(1.0), GravityScale(0.0), Ccd { enabled: true }, // Prevent clipping when going fast TransformBundle::fromtransform(Transform::fromxyz(0.0, 3.0, 0.0)), LogicalPlayer(0), FpsControllerInput { pitch: -TAU / 12.0, yaw: TAU * 5.0 / 8.0, ..default() }, FpsController { ..default() } )); commands.spawn(( Camera3dBundle::default(), RenderPlayer(0), )); ... } ```
Used by my other project: https://github.com/qhdwight/voxel-game-rs
https://user-images.githubusercontent.com/20666629/157115719-719a1e7b-a308-4239-919f-8daa9f2ef6e3.mp4