diff --git a/Cargo.toml b/Cargo.toml index c7f5c67889eac..65bbc514271b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2159,13 +2159,13 @@ wasm = false name = "fallible_systems" path = "examples/ecs/fallible_systems.rs" doc-scrape-examples = true +required-features = ["bevy_mesh_picking_backend"] [package.metadata.example.fallible_systems] name = "Fallible Systems" description = "Systems that return results to handle errors" category = "ECS (Entity Component System)" wasm = false -required-features = ["bevy_mesh_picking_backend"] [[example]] name = "startup_system" @@ -4003,7 +4003,6 @@ name = "Sprite Picking" description = "Demonstrates picking sprites and sprite atlases" category = "Picking" wasm = true -required-features = ["bevy_sprite_picking_backend"] [[example]] name = "debug_picking" diff --git a/examples/ecs/fallible_systems.rs b/examples/ecs/fallible_systems.rs index 6d24cc3ca2388..59e82371a353a 100644 --- a/examples/ecs/fallible_systems.rs +++ b/examples/ecs/fallible_systems.rs @@ -6,6 +6,8 @@ use bevy::math::sampling::UniformMeshSampler; use bevy::prelude::*; use rand::distributions::Distribution; +use rand::SeedableRng; +use rand_chacha::ChaCha8Rng; fn main() { let mut app = App::new(); @@ -68,7 +70,7 @@ fn setup( mut meshes: ResMut>, mut materials: ResMut>, ) -> Result { - let mut rng = rand::thread_rng(); + let mut seeded_rng = ChaCha8Rng::seed_from_u64(19878367467712); // Make a plane for establishing space. commands.spawn(( @@ -116,7 +118,7 @@ fn setup( }); // Add sample points as children of the sphere: - for point in distribution.sample_iter(&mut rng).take(10000) { + for point in distribution.sample_iter(&mut seeded_rng).take(10000) { sphere.with_child(( Mesh3d(point_mesh.clone()), MeshMaterial3d(point_material.clone()),