From 0a8d83ffb63689f3aaee278d772e5d63127c955e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Mon, 26 Feb 2024 13:47:29 +0100 Subject: [PATCH] Changed Transform Update order --- GlitchyEngine/src/World/Scene.bf | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/GlitchyEngine/src/World/Scene.bf b/GlitchyEngine/src/World/Scene.bf index a202f9b..976ddab 100644 --- a/GlitchyEngine/src/World/Scene.bf +++ b/GlitchyEngine/src/World/Scene.bf @@ -701,6 +701,7 @@ namespace GlitchyEngine.World } // TODO: Execute Fixed-Updates + TransformSystem.Update(_ecsWorld); } } @@ -754,13 +755,18 @@ namespace GlitchyEngine.World { Debug.Profiler.ProfileRendererFunction!(); - TransformSystem.Update(_ecsWorld); + if (mode.HasFlag(.Physics)) + { + UpdatePhysics(gameTime); + } if (mode.HasFlag(.Scripts)) { UpdateScripts(gameTime, mode); } + TransformSystem.Update(_ecsWorld); + if (!_destroyScriptQueue.IsEmpty) { for (let scriptInstance in _destroyScriptQueue) @@ -784,11 +790,6 @@ namespace GlitchyEngine.World _destroyQueue.Clear(); } - - if (mode.HasFlag(.Physics)) - { - UpdatePhysics(gameTime); - } } /// Creates a new Entity with the given name.