Descriptor 'get_editor_world' of 'UnrealEditorSubsystem' object needs an argument

I’m playing with Python in editor.
When i use construction
world = unreal.EditorLevelLibrary.get_editor_world()
it works, but says that this construction is deprecated, and i must ““Use the function in Unreal Editor Subsystem””

But when i use following construction
world = unreal.UnrealEditorSubsystem.get_editor_world()
Console writes “descriptor ‘get_editor_world’ of ‘UnrealEditorSubsystem’ object needs an argument”.

What argument i need? (“Self” - not working)

1 Like

The BlueprintCallable function in SubSystem is not static, and the subsystem is not “always be there”. So we need to get the subsystem first, then call the function. For instance:

world = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world()
6 Likes