How to Pass a TArray to a BlueprintImplementableEvent?

I have a BP Implementable function that looks like this:

	UFUNCTION(BlueprintImplementableEvent, Category = "Event")
	bool Evaluate(UObject* obj1, UObject* obj2, UObject* obj3, TArray<UObject*> ArrayOfObjects);

However, this array is causing a ton of issues. If I leave it as a naked array like that, then my code fails to compile, instead giving me the error that

Evalute: Overloaded Member Function not Found in 'MyClass'

If I make it a TArray&, the code compiles, however instead of the parameter being provided to the function in the BP as expected, it is instead required by the return value node, like this:
Capture

Finally, if I make it a TArray*, or a TObjectPtr<TArray>, both fail to compile citing that either is an invalid type. So how do I actually pass this array to the BP event? Is this simply a bizarre limitation of the engine and it’s not possible, or is there a solution that works?

Try like this.

const TArray<UObject*>& ArrayOfObjects

Edit: Actually, it seems there was a typo elsewhere that somehow still compiled. Oops! With that fixed and passing in a const tarray ref, it does seem to be working as expected now. Thank you.

1 Like