bevy_fpc_core 0.1.3

Core features for `bevy_fpc`
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Module related to player control of first person controller

use crate::Player;
use bevy::prelude::*;

/// Give vision to a player from the first person controller point of view.
pub fn embody(mut commands: Commands, query: Query<Entity, Added<Player>>) {
    query.iter().for_each(|entity| {
        if let Some(mut ec) = commands.get_entity(entity) {
            ec.with_children(|builder| {
                builder.spawn(Camera3dBundle::default());
            });
        }
    });
}