From 3286b7fb378b91399525a4dcfebf4afc9ea05f91 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Mon, 10 Feb 2025 10:40:23 +0000 Subject: [PATCH] Physics Interpolation - fix client interpolation pump Client interpolation pump is moved AFTER the physics tick, after physics objects have been moved. This is necessary because the `current` transform is also updated during the pump. --- scene/main/scene_tree.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index abb6f8ec9071..12e2e6cfe02d 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -506,13 +506,6 @@ void SceneTree::iteration_prepare() { // are flushed before pumping the interpolation prev and currents. flush_transform_notifications(); RenderingServer::get_singleton()->tick(); - -#ifndef _3D_DISABLED - // Any objects performing client physics interpolation - // should be given an opportunity to keep their previous transforms - // up to date before each new physics tick. - _client_physics_interpolation.physics_process(); -#endif } } @@ -552,6 +545,13 @@ void SceneTree::iteration_end() { // to be flushed to the RenderingServer before finishing a physics tick. if (_physics_interpolation_enabled) { flush_transform_notifications(); + +#ifndef _3D_DISABLED + // Any objects performing client physics interpolation + // should be given an opportunity to keep their previous transforms + // up to date. + _client_physics_interpolation.physics_process(); +#endif } }