How to reference widget class using String

how can i do this? instead of selecting the widget, refrence its location using string… Thank you

Like this:

In Blueprints you can do that from soft class reference, you also will need to use Name not String

Once oyu got soft reference you need to resolve it to full class refrence

You can even use soft object reference for objects!

Seeing how this was accepted and what said;

while using a Soft Class Reference wouldn’t allow you to reference widget class using a String as in the topic, it’s definitely a much better solution here even if you plan to load & create all the widgets anyway.

You can still use a map if you wish and keep a friendly string name:


I’m going to gloss over the fact that I do not fully understand why you’d want to do it like this. It can be done, though.

1 Like

Thank you, but why this is “a much better solution” ? is this beause of memory usage? (i’m new)

Name type is using hashing, which means its a lot faster to process by CPU then String, like comparison or finding etc. if you make any ID varable you should use Name insted of String

1 Like