#Code Produces Error

3 messages · Page 1 of 1 (latest)

naive tree
#

I have a simple snippet of code that creates a 3D rendered scene with an ambient light:

fn main() {
    App::new().add_plugins(DefaultPlugins.set(
        WindowPlugin {
            primary_window: Some(Window {
            title: "Test".into(),
            resolution: (800., 600.).into(),
            present_mode: PresentMode::AutoNoVsync,
            ..default()
        }), 
        ..default()
    })).add_startup_system(setup).run();
}

fn setup(
    commands: &mut Commands,
) {
    //Camera3D
    commands.spawn(Camera3dBundle {
        transform: Transform::from_matrix(Mat4::from_rotation_translation(
            Quat::from_xyzw(-0.3, -0.5, -0.3, 0.5).normalize(),
            Vec3::new(-7.0, 20.0, 4.0)
        )),
        ..default()
    });

    commands.insert_resource(AmbientLight {
        color: Color::WHITE,
        brightness: 0.02,
    });
}
#

Within my main loop, passing setup to add_startup_system produces this error:
required by a bound introduced by this call

ripe mist
#
fn setup(
    mut commands: Commands,
) {

should work