How to switch to a level using Editor Utility Widget (which World Context Object to use)?

Hey, I’m new to creating editor tools, so here is my question:

I want to create a Editor Utility Widget for opening levels without having to search / traverse the content browser. For thesting this, I’ve created a widget containing a single button, which should load my “MainMenu” map on click.
I currently have the OnClicked node connected to the OpenLevelByReference node, which requires a World Context Object. I tried several objects (including self, unreal editor subsystem, …) but I can’t get it to work. What should I use here?

Hi @grinn2!

You were very close. This is the node you’re looking for:

Welcome to editor scripting! You’ll have many similar headaches ahead of you haha. As someone who has been making editor tools for quite a while, the best piece of advice I can offer is to work backwards. There is a lot of overlap between gameplay nodes and editor nodes (as you’ve discovered) and it is rarely obvious which ones you can use for scripting. In this case, you knew you wanted to open a level, so start with a level editor subsystem node, since their functionality is limited to in-engine tooling for the most part. Dragging out from that pin will give you a list of context-specific nodes, so you can safely assume that most of those nodes can be used with the editor. In your case, dragging out from the Level Editor Subsystem and typing in “Level” gives you these options:

Best of luck with your scripting!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.