Struct to bool pin dragging in BP

Hello all,

I wasn’t quite sure what to google to get this answer. I’ve often in blueprints seen something where you can drag a pin from a struct or class to like a boolean input and BP knows to return a specific member of the struct or class.

I have my own blueprint struct written in cpp that is called ErrorBool which just has a boolean and a string (error message). I’d like to make it so that if I drag my boolean to a branch condition input, it knows to return the boolean part of the struct rather than getting the member myself and returning it. It’ll help save time in the long run and honestly I’m curious how that stuff works.

Thanks!

You need the function to return you the bool value. You can try a function definition like:

UFUNCTION(BlueprintCallable, Category = "MapTiles")
void SpawnMapTiler(bool& bStatus)

I would use BlueprintPure instead of BlueprintCallable

You can also try splitting the struct by right clicking on the connection point.

Thanks everyone!

Yea I know about splitting but I was hoping to just drag the pin and drop it and have it automatically get the bool.
What you are suggesting didn’t work since you cannot really add UFUNCTIONS to structs.

What I’m hoping to do is just by dragging and dropping the struct onto the branch boolean have BP automatically know to get the boolean from the struct.