There is no "Create Child WIDGET Blueprint class" option, so I'm f*ckd

You can create a BP_Master with basic functionality of it’s class, and then select it and Create Child classes for variations from the master. Daily routine, isnt’ it?

Well, just found you can not do the same thing with Widget Blueprints. But I really need to!

This is why:

In this function I’m looping through all Widget Components present in the BP (they can be none or a bunch of them, with independent styles), to set it’s new text content.

My idea was so simple! Now I’d create children Widget Blueprints of that W_TextBox, (variations like W_Headline, W_Title; W_LongParagraph, W_Question, etc, with different design and layout, you get it). All of them would pass the cast to daddy W_Textbox, so this simple code would be enough to update all components no matter which style child widget they are using.

There’s no “Create Child WIldger BP” option, as there is for normal blueprint classes.

I always have this ugly workaround : (

Really? It can be long, I have lot of styles. No way.

I’d bet this is not the way to do this. As always, I’m probably missing something. In fact… as I’ve commented in the bubbles at the first example, Why do I have to cast the component? Its supposed to be pre-casted by the previous node. Isn’t it? I’d expect a note of the engine telling me that cast is not necessary. I don’t get this, that’s why I’m almost sure I’m missing something big in front of my eyes.

Any help is gold. Thanks.

You can just create a new widget blueprint and open it up then go to File > Reparent Blueprint and select your base widget BP. I do this myself.

2 Likes

Yesssss!

Oh God… that’s the elephant in front of my eyes I was missing. I’ve spent hours today stucked on this. Rookies…

Of course, it works. (and no widget component cast to widget component needed :smile: )

THANK YOU @JaredTherriault

Glad to help :slight_smile:

1 Like

I’ll leave a last comment for whoever could read this thread in the future.

When trying to replicate the working example setup into my current project, I found it did not work anymore. The child widget is not passing the Cast to it’s parent class.

After a couple of hours of checking, head-scratching, re-checking, and so, I found the problem:

The Cast fails if performed within a function. Don’t ask me why, no idea.

Just moved those update nodes from a function to a CustomEvent present in the main graph of the bp, and working again.

EDIT: Casting is also failing when performed in a Editor Utility. (and that’s a huge complication for my workflow)

@JaredTherriault ,

if you have a couple of minutes, would you take a look at this post?

It’s a sequel of this one and others.