Custom Macro Library from within Widget

This is a straight forward one really.

I can’t seem to call a function from my custom macro library from within a widget blueprint.
I can call the functions from other blueprints, but just not the widget blueprint.

Is there a way I can do this, or do I need to create a macro inside of the widget?

Thanks in advance :slight_smile:

1 Like

Same question here :slight_smile:

Just solved it, you need to have a special Macro Library for Widgets. When you create a macro library, there is a step to specify parent class. When you select Actor class, the macro library will be for Actors. To use macro library from Widgets, create a new macro library choosing “UserWidget” as a parent class.

2 Likes

Just stumbled across this problem again and surprised myself that I’ve answered this, I didn’t remember it :smiley: … So basically the past-version of me answered my current-version of me. Interesting.

If my answer has helped, could you please accept it? :slight_smile: Thanks!

1 Like

Lol, I didn’t even see the answer, and completely forgot I posted the question.
That’s how I ended up doing it, so yes, you’re absolutely right haha XD

So you basically need to make two versions of your macro library? Isn’t there a way to make a library available on both Widgets and Actors?

1 Like

You can, but you have to define parent class as Object.

no such option, @t0msk

(no big deal, I’ve just copied a couple of macros from the Library to the widget, but still curious.)

this is true but unfortunately if the parent class is Object you can’t have latent functions in the macro - a major reason I use a macro library at all!