However trying to run this system panics
thread '<unnamed>' panicked at src/fps_game/controller.rs:149:28:
called `Result::unwrap()` on an `Err` value: NoEntities("bevy_ecs::query::state::QueryState<(&bevy_transform::components::transform::
Transform, &fps_test::fps_game::controller::InputVector, &fps_test::fps_game::controller::Speed, &mut fps_test::fps_game::controller:
:Velocity, &mut bevy_rapier3d::control::character_controller::KinematicCharacterController, &bevy_rapier3d::control::character_contro
ller::KinematicCharacterControllerOutput), bevy_ecs::query::filter::With<fps_test::fps_game::controller::Player>>")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `fps_test::fps_game::controller::update_physics`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
Removing the KinematicCharacterControllerOutput from the query gets rid of the panic
This is the code for spawning the player
pub fn spawn_player(mut commands: Commands) {
let player = PlayerBundle {
marker: Player,
speed: Speed(10.0),
rigidbody: RigidBody::KinematicPositionBased,
collider: Collider::capsule(
Vec3::new(0.0, -PLAYER_HEIGHT * 0.25, 0.0),
Vec3::new(0.0, PLAYER_HEIGHT * 0.25, 0.0),
PLAYER_HEIGHT * 0.25,
),
controller: KinematicCharacterController::default(),
transform: SpatialBundle {
transform: Transform::from_xyz(0.0, PLAYER_HEIGHT / 2.0, 0.0),
..Default::default()
},
..Default::default()
};
commands.spawn(player).with_children(|parent| {
parent.spawn(PlayerWorldCameraBundle {
marker: PlayerWorldCamera,
camera: Camera3dBundle {
transform: Transform::from_xyz(0., CAMERA_HEIGHT, 20.0),
..Default::default()
},
});
});
}