@@ -27,16 +27,22 @@ pub fn plugin(app: &mut App) {
2727 app. add_plugins ( (
2828TnuaControllerPlugin :: new ( FixedUpdate ) ,
2929TnuaAvian3dPlugin :: new ( FixedUpdate ) ,
30- #[ cfg ( feature ="third_person" ) ]
31- ThirdPersonCameraPlugin ,
32- #[ cfg( feature ="top_down" ) ]
33- TopDownCameraPlugin ,
3430 control:: plugin,
3531 sound:: plugin,
3632) ) ;
3733
38- app. configure_sets ( PostUpdate , CameraSyncSet . after ( PhysicsSet :: Sync ) )
39- . add_systems ( OnEnter ( Screen :: Gameplay ) , spawn_player)
34+ #[ cfg( feature ="third_person" ) ]
35+ app. add_plugins ( ThirdPersonCameraPlugin ) . configure_sets (
36+ PostUpdate ,
37+ bevy_third_person_camera:: CameraSyncSet . after ( PhysicsSet :: Sync ) ,
38+ ) ;
39+ #[ cfg( feature ="top_down" ) ]
40+ app. add_plugins ( TopDownCameraPlugin ) . configure_sets (
41+ PostUpdate ,
42+ bevy_top_down_camera:: CameraSyncSet . after ( PhysicsSet :: Sync ) ,
43+ ) ;
44+
45+ app. add_systems ( OnEnter ( Screen :: Gameplay ) , spawn_player)
4046. add_systems (
4147Update ,
4248 animating
@@ -76,7 +82,7 @@ pub fn spawn_player(
7682StateScoped ( Screen :: Gameplay ) ,
7783 pos,
7884 player,
79- // camera
85+ // camera target component
8086(
8187#[ cfg( feature ="third_person" ) ]
8288ThirdPersonCameraTarget ,