How to add button to blueprint details panel?

I want to add a button to my blueprint’s detail panel, like the one from the Sky Light component (see attached image). How can I achieve that?



You would have to dig into that class in C++.

Look inside Engine’s source code for this class:


It is not an UObject, it’s pure C++ so you must be careful when using it to not generate memory leaks :slight_smile:

Thanks for the info guys, I did look into that class, looks like C++ is the only way to do that. It would be nice to have a “Button” variable type for blueprints :slight_smile:

Try Blutilities. Maybe it helps

Can we please have a button without writing 2 pages of code? Thank you.

Well, you can make a an Event to a Blutility button by checking “Call in Editor”. If you select an instance of that Actor in the scene and scroll down in the details panel on the right, you should find a blutility dropdown menu.

Other than that, no we can not have a button without writing 2 pages. The Engine editor is build around slate and you can’t dodge writing C++/Slate for everything. Blueprints don’t cover everything.

I’m using a checkbox, which is the most simple button replacement, using just the bool UProperty.
That’s one line.
Make sure to reset your boolean in PostEditChangeProperty.
Would be great to extend the UProperty meta-data, so we can show a real button instead of a checkbox.
Might need 4 lines in engine code and could help a lot of developers.

Amen to that!

It is now as simple as it should be, just add:

UFUNCTION(BlueprintCallable, CallInEditor)

macro above your function, recompile and button will be there.

Sorry for necro-ing old thread, but it’s easier to find this than actual answer.

Omg <3, just needed this!

Thanks for the update!

You can also define function in bp, and check “Call In Editor”.

Fantastic, thanks for sharing this! Super easy now.