From 4414398f094e3286b6ed4392e6f88e3f8714d499 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 26 Apr 2024 19:08:25 +0200 Subject: [PATCH] Fix crash when accessing physics objects state in `OnLateFixedUpdate` #2494 --- Source/Engine/Engine/Engine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Engine/Engine/Engine.cpp b/Source/Engine/Engine/Engine.cpp index 0a500eaf4..20063ca0f 100644 --- a/Source/Engine/Engine/Engine.cpp +++ b/Source/Engine/Engine/Engine.cpp @@ -286,14 +286,14 @@ void Engine::OnLateFixedUpdate() { PROFILE_CPU_NAMED("Late Fixed Update"); + // Collect physics simulation results (does nothing if Simulate hasn't been called in the previous loop step) + Physics::CollectResults(); + // Call event LateFixedUpdate(); // Update services EngineService::OnLateFixedUpdate(); - - // Collect physics simulation results (does nothing if Simulate hasn't been called in the previous loop step) - Physics::CollectResults(); } void Engine::OnUpdate()