INNER CODE UNIT · Rust
build
dust-engine/dust · crates/character/src/lib.rs:28
fn build(&self, app: &mut App) {
// Movement runs on the physics tick so move-and-slide sees consistent
// collider positions; looking runs every frame so the mouse stays smooth.
app.add_systems(FixedUpdate, move_character)
.add_systems(Update, look_and_camera);
}
}
/// How the character moves.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Mode {
/// Gravity, ground detection, jumping and step-up through move-and-slide.
Walk,
/// Free flight along the look direction, through everything. A debug aid.
Fly,
}
/// Where the camera sits relative to the character.