diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index 610974ff90c8..092efc55d7d4 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -1176,11 +1176,6 @@ bool CharacterBody3D::move_and_slide() { } } - if (!on_floor && !on_wall) { - // Add last platform velocity when just left a moving platform. - linear_velocity += current_floor_velocity; - } - if (was_on_floor && snap != Vector3()) { // Apply snap. Transform3D gt = get_global_transform(); @@ -1213,6 +1208,11 @@ bool CharacterBody3D::move_and_slide() { } } + if (!on_floor && !on_wall) { + // Add last platform velocity when just left a moving platform. + linear_velocity += current_floor_velocity; + } + return motion_results.size() > 0; }