I just started learning Unreal and I’m starting to wrap my head around Hard and soft references. I created blueprints to generate a “base” UI widget that can asynchronously load additional widgets in a stack. However, so far I’ve been unable to find a way to create the original base widget without using hard references.
Does anyone know if this is even possible? I understand some hard references are fine, but I am trying to figure out whether I even have a choice in the matter since as far as I am aware I have to use “create widget” with the player controller which seems like it will always result in a hard reference. Thanks!
This is one of those things that likely can’t be avoided least in Blueprint there may be a c++ way i don’t know of
But when the widget is created you’ll always need to read/display it
When it’s destroyed it gets removed from recourses
when it’s hidden its still there but not rendered
So basically doesn’t matter unless your doing something crazy widgets are usually fairly small and won’t be whats hogging the resources a couple Mb at most
Hi, did you make sure to use only the base widget class as base class in your soft class reference (and not your actual class)? Cause you get a hard reference to the base class you use in your soft reference.
Thanks for the feedback. I was able to get it to work without a hard reference by async loading my blueprint class and then casting it to a user widget and then plugging that into the create widget. Then I was able to use interfaces for any functions I needed.