Python integration with Unreal Engine 5

atidorfa
2 min readMay 22, 2022

--

Python is perhaps one of the best quick scripting programming languages, so it's really useful to work with it in the unreal engine environment for debugging, asset-repairing / cleaning, data streaming in real-time, and a lot more implementation using pythons open-source libraries.

How to enable it in Unreal Engine 5 Editor:

Go to Plugins and check this 2 are enabled:

Go to Project Settings — Plugins — Python — Go to Advanced and check Developer Mode

Restart and check the project folders for the unreal.py file in Intermediate/PythonStub/unreal.py (This is a definition file with a lot of python functionality and may help you to develop if read all the functions it provides).

Let’s make a simple python script: logger.py

You can go to the output log and run it:

To add scripts to run as soon the editor starts running add them to:

  • Startup Scripts list/array of the scripts to be executed as soon as the editor starts.
  • Additional Paths are used to add paths to every script that can be found in any computer or environment.

Adding PyCharm Autocompletion in Python Interpreter:

For VSCode autocompletion you can follow this link: https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/ScriptingAndAutomation/Python/Autocomplete/

You are ready to start working with your own python scripts and Unreal Engine.

--

--