@@ -27,23 +27,33 @@ Let's try to clarify things wth another example (read comments carefully):
2727
2828
2929``` python
30- from unreal_engine.classes import WorldFactory
30+ import unreal_engine as ue
31+ from unreal_engine.classes import WorldFactory, Actor, PlayerStart
3132
3233factory = WorldFactory()
3334
3435# create a world (it will be the main one, the one you load into the editor by double clicking it)
35- main_world = factory.factory_create_new(' /Game/Maps/MainWorld001' )
36+ main_world = factory.factory_create_new(' /Game/MapsTest/MainWorld001' )
37+ # spawn actors in the world
38+ actor0 = main_world.actor_spawn(PlayerStart)
3639
3740# create another world
38- child_world1 = factory.factory_create_new(' /Game/Maps/ChildWorld001' )
41+ child_world1 = factory.factory_create_new(' /Game/MapsTest/ChildWorld001' )
42+ # spawn actors in the world
43+ actor1 = child_world1.actor_spawn(Actor)
44+ actor2 = child_world1.actor_spawn(Actor)
45+ actor3 = child_world1.actor_spawn(Actor)
3946
4047# create another world
41- child_world2 = factory.factory_create_new(' /Game/Maps/ChildWorld002' )
48+ child_world2 = factory.factory_create_new(' /Game/MapsTest/ChildWorld002' )
49+ # spawn actors in the world
50+ actor4 = child_world2.actor_spawn(Actor)
4251
4352# now the important part, each UWorld, has a ULevel mapped to it (the PersistentLevel):
44-
4553main_level = main_world.PersistentLevel
4654child_level1 = child_world1.PersistentLevel
4755child_level2 = child_world2.PersistentLevel
4856
57+ # open main world in the editor
58+ ue.open_editor_for_asset(main_world)
4959```
0 commit comments