diff --git a/crates/rust4d_physics/src/world.rs b/crates/rust4d_physics/src/world.rs index 2340411..ba6a41d 100644 --- a/crates/rust4d_physics/src/world.rs +++ b/crates/rust4d_physics/src/world.rs @@ -187,13 +187,16 @@ impl PhysicsWorld { } // Phase 1: Apply gravity and integrate velocity - for (_key, body) in &mut self.bodies { + for (key, body) in &mut self.bodies { if body.is_static() { continue; } - // Apply gravity - if body.affected_by_gravity() { + // Apply gravity to: + // - Dynamic bodies (normal physics objects) + // - The player body (kinematic but needs gravity for jumping/falling) + let is_player = self.player_body == Some(key); + if body.affected_by_gravity() || is_player { body.velocity.y += self.config.gravity * dt; }