From 146be24a7c0ed714f6e533f707e3b21df3176609 Mon Sep 17 00:00:00 2001 From: Franklin Date: Tue, 12 Sep 2023 11:33:04 -0400 Subject: [PATCH] FPS camera done. Camera rotates but player doesn't --- src/comps/core/controller.rs | 29 +++++++++- src/logic/core/player/camera_player_sync.rs | 62 ++++++++++++++++++--- src/logic/core/player/player_movement.rs | 38 +++++-------- src/logic/core/player/spawn_player.rs | 6 +- src/scenes/scene1/init.rs | 5 +- 5 files changed, 104 insertions(+), 36 deletions(-) diff --git a/src/comps/core/controller.rs b/src/comps/core/controller.rs index 436778c..c5ef236 100644 --- a/src/comps/core/controller.rs +++ b/src/comps/core/controller.rs @@ -1,4 +1,4 @@ -use bevy::prelude::*; +use bevy::{prelude::*, window::CursorGrabMode}; use bevy_rapier3d::prelude::*; use crate::logic::core::player::player_movement::{PlayerMovementInput, move_player, PlayerLinearYState}; @@ -6,7 +6,7 @@ use crate::logic::core::player::player_movement::{PlayerMovementInput, move_play use super::markers::player::Player; /// System that captures input and fires events -pub fn capture_input(keyboard_input: Res>, query: Query<(&mut Velocity, &mut ExternalImpulse, &mut PlayerLinearYState), With>, time: Res