Return a value from a BlueprintImplementableEvent

I wish to write a function whose implementation is in Blueprint. Further, I would like this function to return a boolean value. I tried to create a BlueprintImplementableEvent that returned a boolean. However, despite no errors from UBT, this did not show up as an event in the BP editor.

UFUNCTION(BlueprintImplementableEvent, Category = Tracking)
bool IsActorInJunction(AActor* Actor);

I also tried changing it to pass in the boolean as a reference, but this also did not generate the event. (Passing in a pointer causes a UBT error).

I have worked around this by having a BP exposed variable which I call an event to set this when I actually want the value. Is there a better way?

Have you tried this ?

UFUNCTION(BlueprintImplementableEvent, Category = Tracking)
void IsActorInJunction(AActor* Actor, bool& Result);

This will not create an event block, but new function in your blueprint, you have to implement it.

8695-1.png

8696-2.png

Cheers!

3 Likes

That looks ideal, I shall try out post haste!

That is much better, thank you. A small thing, but is there no way to have it return result rather than having to pass it in?

Great! I’ve never heared of any other method:/