diff --git a/scene/animation/animation_blend_space_1d.cpp b/scene/animation/animation_blend_space_1d.cpp index 6128ecb7895f..071862442840 100644 --- a/scene/animation/animation_blend_space_1d.cpp +++ b/scene/animation/animation_blend_space_1d.cpp @@ -207,12 +207,12 @@ void AnimationNodeBlendSpace1D::set_blend_point_node(int p_point, const Ref AnimationNodeBlendSpace1D::get_blend_point_node(int p_point) const { - ERR_FAIL_INDEX_V(p_point, MAX_BLEND_POINTS, Ref()); + ERR_FAIL_INDEX_V(p_point, blend_points_used, Ref()); return blend_points[p_point].node; } diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp index befe42ad0b1b..adc9cd3e4a60 100644 --- a/scene/animation/animation_blend_space_2d.cpp +++ b/scene/animation/animation_blend_space_2d.cpp @@ -126,12 +126,12 @@ void AnimationNodeBlendSpace2D::set_blend_point_node(int p_point, const Ref AnimationNodeBlendSpace2D::get_blend_point_node(int p_point) const { - ERR_FAIL_INDEX_V(p_point, MAX_BLEND_POINTS, Ref()); + ERR_FAIL_INDEX_V(p_point, blend_points_used, Ref()); return blend_points[p_point].node; }