From 80208058304df9357e3d8ecf451f5a55dc19cfda Mon Sep 17 00:00:00 2001 From: IWonderWhatThisAPIDoes <96886300+IWonderWhatThisAPIDoes@users.noreply.github.com> Date: Tue, 27 Feb 2024 02:44:50 +0100 Subject: [PATCH] examples/ecs/iter_combinations: Initialize velocity using fixed timestep (#10673) # Objective On some platforms (observed on Windows and Linux, works fine on web), velocity of all entities would be initialized to zero, making them simply fall into the star. ## Solution Using `Time::timestep` instead of `Time::delta_seconds` to initialize velocity. Since the entities are generated in the startup schedule, no time has elapsed yet and `Time::delta_seconds` would return zero on some platforms. `Time::timestep` will always return the expected time step of `FixedUpdate` schedule. --- examples/ecs/iter_combinations.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ecs/iter_combinations.rs b/examples/ecs/iter_combinations.rs index 850cae7ad90c6..0e80b68ba9b92 100644 --- a/examples/ecs/iter_combinations.rs +++ b/examples/ecs/iter_combinations.rs @@ -34,7 +34,7 @@ struct BodyBundle { } fn generate_bodies( - time: Res