When i execute this script in UE4, it works successfully.
When i run this script on command line with:
“C:\Program Files\Epic Games\UE_4.27\Engine\Binaries\Win64\UE4Editor-Cmd.exe” “C:\Users\Documents\Unreal Projects\test\test.uproject” -run=pythonscript -script=“D:/test_unreal.py”
I get this error and UE4 crashes:
The python script has only these lines:
import unreal
import time
unreal.EditorLevelLibrary.load_level(asset_path=‘/Game/StarterContent/Maps/Minimal_Default’)
unreal.EditorLevelLibrary.spawn_actor_from_object(unreal.CameraActor(name=‘camera1’), location=(0,0,0))
Up to the third line it works fine, but its the 4th line that crashes UE when running it from command line. Anyone knows why??