C++ Blueprint Node parameter direction

Hello everyone looking this up,
i hop right to my question.

here is the problem Node:

with the associated header code:


UCLASS(BlueprintType, Meta = (BlueprintSpawnableComponent))
class MYPROJECT_API UNeuralNetworkManager : public UActorComponent
{
	GENERATED_BODY()
public:
	UNeuralNetworkManager();
	UFUNCTION(BlueprintCallable, Category = "AI")
		virtual void BeginPlay() override;
	UFUNCTION(BlueprintPure, Category = "AI")
		void execNet( float &inputVals1, float &inputVals2, float &targetVals);
	UFUNCTION(BlueprintCallable, Category = "AI")
		float getResultsNetwork();

private:

	int TestZahl;
	UNeuralNetwork  *nNet;
};

basically the problem is, that the InputVals and TargetVals are on the right side and i dont know how to bring them over to the left side.

i think it has to do with the ufunction Specifiers but since im new to unreal i have no clue how to fix it.

btw i tried to search the forum but i couldnt find anything regarding this problem.

if you need more code example dont hestitate to ask.

Thanks in advance for all your help.

Hello Flinng,

The reason that the pins are on the right side of the node is because they are reference variables. Remove the ampersand symbols and unreal should recognize them as inputs.


void execNet(float inputVals1, float inputVals2, float targetVals);

You can also use const references like:


const float &inputVals1

in this case it’s a float so it may not make much sense.
But if you want to change the value of the variable created by the blueprint in this node, I don’t think you can by reference as far as I know.

As said above, if you don’t want the function to be able to modify the parameters, just remove the &.

If it’s intentional, you can add UPARAM(ref) to make something an input/output parameter. See here. In that case though, your function should be BlueprintCallable, not Pure.

Thank you very much, something new to learn every day:)

works fine now