Open aaronfranke opened 1 year ago
I am justing putting this under this report, maybe it is related. I have a simply lerp function :
freq_low = lerp(min_freqs, max_freqs, freqs_low)
It was working perfectly in A13, but now throws an error : "Invalid Call. Nonexistent Utlity Function 'lerp' "
I checked if there are any changes to the helpdocs or issues, but apparently not so this must be a bug.
Found out the lerp function complains a lot if one of the arguments is not the same type as the others. ~Ex. (int, int, float) or (float, int, float) It works with either (float, float, float), or (int, int, int)~ Edit: As aaronranke said on the response, only the two first need to match
@yaelatletl Only the first two arguments need to match, since the weight is always a float
(C++ double
).
It sometimes also happens event to floats, apparently randomly. I had to implement my own function my_lerp(a, b, t) : a + t(b-a) to avoid the error.
Hi there, I got this same issue, definitely related to the first 2 arguments matching, should a better error message be thrown, or should we try to convert better? I'd be willing to take a shot trying to fix the issue if there is a decision on what should be done
Hi there, I got this same issue, definitely related to the first 2 arguments matching, should a better error message be thrown, or should we try to convert better? I'd be willing to take a shot trying to fix the issue if there is a decision on what should be done
The Godot 3 -> 4 project converter is not aware of the arguments' types (it only performs text replacement). This means it unfortunately can't replace lerp()
with lerpi()
or lerpf()
when possible.
Godot version
master as of #60924
System information
N/A
Issue description
I'm getting this error when one argument is a float and one argument is an int. The error message is confusing because it looks like it's trying to convert to nil. I assume it's triggering the
if (from.get_type() != to.get_type()) {
condition in the PR, and the solution is simply for me to switch to lerpf and/or cast my inputs to float, but it's poor UX right now.Another small problem I noticed with
lerp()
is that the weight is currently aVariant
, but it should be afloat
(double
). It's strange that it shows up as a Variant, because the method argument has the correct type.Steps to reproduce
Minimal reproduction project
Paste the above code snippet into any Godot project.