In the previous chapter, we talked about why Python can be useful, and how to follow this training.
Here, we’ll see how to configure a UE project to be able to run Python.
Table of contents
Using Python inside of Unreal is quite new. It’s supported on UE 4.26 and newer versions, but it’s still an experimental feature in development. It was possible on older version of UE as well, but it was not something developed by Epic.
The way it works is simple
The Python Interpreter (python.exe
) is packaged inside of UE, so you don’t need to install Python on your machine.
However if you have Python installed, don’t worry it’s not a problem, UE will use that one:
<aside> ❔ The Python Interpreter is a program that execute Python Just In Time (JIT), meaning there is no need to compile your program, it will be interpreted/compiled when running.
</aside>
To execute Python from UE, a plugin called Python Editor Script Plugin is provided. This is a C++ plugin that will add features (blueprint nodes, editor menus, …) but eventually will just call python.exe
.
Running Python from UE is super useful, but you should know what you can do and what you cannot.
Now, let’s configure our UE project.
Start with a UE 5.0 project, or get the one available in Getting the project files.
To run Python code in UE, we have to make sure the Python Editor Script Plugin plugin is enabled. Go in Edit > Plugins and check it. Then restart UE.