From 307bac0757d0f2d84ff1195de692ff4f00651a15 Mon Sep 17 00:00:00 2001 From: Tomasz Chabora Date: Thu, 23 Jul 2020 22:59:04 +0200 Subject: [PATCH] Keep transition value when replacing key (cherry picked from commit e1a1bb0a6ef14a809395a239f661db20b52a9f0e) --- scene/resources/animation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index a3e61081394..98c82bf0a20 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -821,8 +821,9 @@ int Animation::_insert(float p_time, T &p_keys, const V &p_value) { // Condition for replacement. if (idx > 0 && Math::is_equal_approx(p_keys[idx - 1].time, p_time)) { - + float transition = p_keys[idx - 1].transition; p_keys.write[idx - 1] = p_value; + p_keys.write[idx - 1].transition = transition; return idx - 1; // Condition for insert.