diff --git a/src/camera.rs b/src/camera.rs index 4c69e1e..103ebf4 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -20,6 +20,7 @@ pub struct CameraState { } #[derive(Component, Reflect, Debug)] +#[reflect(Component)] pub struct MainCamera { dir: Dir3, distance: f32, @@ -35,6 +36,8 @@ impl MainCamera { pub fn plugin(app: &mut App) { app.register_type::(); app.register_type::(); + app.register_type::(); + app.init_resource::(); app.add_systems(Startup, startup); app.add_systems(Update, (update, rotate_view_keyboard, rotate_view_gamepad)); @@ -43,7 +46,7 @@ pub fn plugin(app: &mut App) { fn startup(mut commands: Commands) { commands.spawn(( Camera3d::default(), - MainCamera::new(Vec3::new(0., 1., -12.)), + MainCamera::new(Vec3::new(0., 2., -12.)), CameraRotation(0.), )); }