Hi all,
Is anyone familiar with the Python or even C++ interface to control the editor? Essentially, I have a Python script that can start and stop Play-in-Editor, and that script can be run in the Unreal terminal. I’d like to add pause functionality using this:
classmethod set_game_paused(world_context_object , paused ) → bool
docs
But I’m not sure how to get the right World Context Object. If anyone is familiar with getting the right one during play state, whether in Python or C++, that’d be great.
Things that I’ve tried:
- world = unreal.UnrealEditorSubsystem().get_game_world()
- world = unreal.UnrealEditorSubsystem().get_editor_world()
Both of these seem to work when running the Python line individually in the Unreal terminal, but not as part of a Python script.