Setting a Default Float Parameter is turned to a Double type in UFunction

Hello guys,

Still getting into the API’s way of referencing elements. I’ve declared this function:

UFUNCTION(BlueprintPure, Category = "CMBPF - Math", meta = (Keywords = "Parabolic Rundowm"))
static void ParabolicRundown0to1(float BaseInput = 0.0, float InputScale = 2.0, float HorTranslation = -1.0, float ParabolicScale =-1.0, float VerTranslation = +1.0, float &FullOutput = 0.0, float &ParabolicOnly = 0.0);

The Compiler returns with the Error C2440 "Default argument: cannot convert from ‘double’ to ‘float &’ ".
I know that if I set a default argument to one parameter, not doing so in all of them will return with a “missing parameter” error.

What I don’t fully understand is why is it turning the float type into double? The Variable is set to & to be a value that gets returned. I’m not using “static float” as a function type since I want several values to be fetchable.

How should I be declaring this section?

I also tried that and it still said that the conversion from “Double” to “float &” wasn’t possible. What I’m most intrigued by this message is that it’s trying to convert a float plus the & sign as if it was a unit of its own.

In C and C++ (and lot of other C based languages) stated (literal) float numbers are double precision floats, to turn them single precision floats you need to add f at the end so for example 1.0 will be 1.0f

Furthermore, I’ve stumbled upon another instance of this. In this second situation, I had multiple float values and one bool & type. If I don’t declare the float’s default arguments, there is no error. However, if I do determine them, I get the same C2440; this case being “cannot convert from bool to bool &”

The error was in the way that values were written.

The fix was that I forgot to add the bracket in which there are parameters expected.

so ([Type Parameter = value,], Type &Parameter) works.