ue5 editor stutter for quite a long time when i spawn hundreds of actors to level using script, is there a way to solve this?

hello, i am recently using python script to procedurally construct my level, i have a list of asset and their transformation, i using python script, such as:
for asset_path, transform in zip(asset_paths, transforms):
obj = unreal.EditorAssetLibrary.load_asset(asset_path)
actor = unreal.EditorLevelLibrary.spawn_actor_from_object(obj, transform[‘location’], transform[‘rotation’])
every time i run this script, the editor would stuck for a while before it complete the spawning process. is there a better way to do this spawning process without the stutter

I guess, the same thing, with ‘sleep()’ in the loop?

I tried that, still the editor would stuck quite a while. i tried add a progress bar to see the progress, but the progress bar wasn’t response until the process completed.

1 Like