diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp index 5fa9e828370..bc9c6120cc4 100644 --- a/core/math/math_funcs.cpp +++ b/core/math/math_funcs.cpp @@ -91,6 +91,7 @@ int Math::range_step_decimals(double p_step) { } double Math::dectime(double p_value, double p_amount, double p_step) { + WARN_DEPRECATED_MSG("The `dectime()` function has been deprecated and will be removed in Godot 4.0. Use `move_toward()` instead."); double sgn = p_value < 0 ? -1.0 : 1.0; double val = Math::abs(p_value); val -= p_amount * p_step; diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 50904800822..493c7239e3c 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -224,6 +224,7 @@ + [b]Note:[/b] [code]dectime[/code] has been deprecated and will be removed in Godot 4.0, please use [method move_toward] instead. Returns the result of [code]value[/code] decreased by [code]step[/code] * [code]amount[/code]. [codeblock] a = dectime(60, 10, 0.1)) # a is 59.0 diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs index 6e53fae46dc..39ad33c9d63 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs @@ -78,6 +78,7 @@ namespace Godot /// /// Times the will be decreased by /// The decreased value. + [Obsolete("DecTime has been deprecated and will be removed in Godot 4.0, use Mathf.MoveToward instead.")] public static real_t DecTime(real_t value, real_t amount, real_t step) { real_t sgn = Mathf.Sign(value);