Hi everyone. I have paused using UE4 since 4.17 due to some time issues. Right now I have started to use it again with version 4.19. Unfortunately I have noticed that hot-reload doesn’t work anymore with this version. Do I have to reconfigure something or am I missing something else?
I am using Arch Linux and before it worked without any flaws. Right now it is quite annoying that I have to restart the Editor to see my changes in there.
Maybe someone can reproduce the issue.
Create a new C++ class in UE4Editor
Inherit a BP from this class
Implement something in the C++ class (e.g. declare a UPROPERTY UStaticMeshComponent and set it as root component in the constructor) and build.
Open the inherited BP and you will see that the changes have not been reflected.
For building I usually use the terminal with
<PATH_TO_UE4_ENGINE>/Engine/Build/BatchFiles/Linux/Build.sh <PROJECT_NAME>Editor Linux Development -editorrecompile -canskiplink <PATH_TO_PROJECT> -waitmutex -progress
And in 4.17 after that I saw a message that the project was hot-reloading (I don’t remember the exact message anymore). In 4.19 I don’t see it anywhere.
Further even when I click on “build” and “compile” in UE4Editor the changes are not reflected. Thus I am forces to restart the editor. I am quite frustrated right now because I cannot find any proper workflow. Any suggestions? Is it a bug? Where can I report it?
Just to answer my own question and maybe to help some Linux users. I gave UE4 on Linux another try and have looked more into the Unreal Build Tool and have played around with parameters. You can define a randomly named module as a parameter and then hot reload works fine. Especially the -ModuleWithSuffix parameter is necessary for a proper hot reload functionality.
I have written a bash script ue4build that looks like
#!/bin/bash
UNREAL_PATH=[PATH_TO_YOUR]/UnrealEngine;
RANDNUM=$(( ( RANDOM % 1000 ) + 1000 ));
CURR_DIR=`pwd`;
PROJ_NAME=$(basename ${1%.uproject});
PROJ_NAME_MODULE="${PROJ_NAME},${RANDNUM}";
${UNREAL_PATH}/Engine/Build/BatchFiles/Linux/RunMono.sh ${UNREAL_PATH}/Engine/Binaries/DotNET/UnrealBuildTool.exe -ModuleWithSuffix=$PROJ_NAME_MODULE Linux Development -TargetType=Editor -Project="${CURR_DIR}/${PROJ_NAME}.uproject" -canskiplink "${CURR_DIR}/${PROJ_NAME}.uproject" -progress
Put the script in one of your executable directories and make it executable with chmod u+x. Then you can build your project with hot reload just by using the following command
This works perfectly for me. For anybody using QT Creator to build the project, under the ‘Build Steps’ for your project, you can remove all of the make steps and simply call this script to do the build. Other IDEs probably have something similar.