I know that I can use references to tell UE4 to make the function return multiple values for blueprints:
However, what if I need to return 2 actors? They are pointer-types and can not be passed by reference (will throw compiler error).
So:
UFUNCTION(BlueprintCallable, Category = "Foo")
bool Check(EKeyEnum KeyType, AActor &SomeActor); // Won't compile because SomeActor must be of type pointer.
But when I make it a pointer it will no longer be an out-variable for blueprints but will be an in-variable instead:
Error: Missing ā*ā in Expected a pointer type
You can not (in this case) return an actor by pointer because then the blueprint will recognise it as an in-variable instead of an out-variable. I must return the actor(s) as OUT variables without using an TArray if possible.
I know I can use tuples and pairs and structs (or even TArrays). But youāre saying UE4 does not support multiple pointers as return nodes in C++ functions?
I can do it in blueprints though but not in C++⦠That is weird. Usually it is the other way around.
I donāt like using pairs because of their names, I donāt like using custom structs because⦠Need a different struct for each function that has different out-variable names. Tuples are just not efficient and TArrays are even more messy. And the āreal solutionā (pointers and references) are not supported in UE4 when using actors or other types that only support pointersā¦
Is there no Macro to tell the blueprint that my pointer-parameter is an out-variable? That would solve everything.