Warning reference will be nullptred

Hi.
sometimes when I change class that has existing instances in the current open map (in the editor), I get the following warning, in the editor log, after the build is done:

LogHotReload: Re-instancing KAICharacter after hot-reload.
LogHotReload: Re-instancing KAi after hot-reload.
LogProperty: Warning: Serialized Class /Engine/Transient.HOTRELOADED_KOPn_10 for a property of Class /Script/MyG3.KPn. Reference will be nullptred.
    Property = ObjectProperty /Script/MyG3.KPn:processNP.processNP
    Item = HOTRELOADED_KOPn_10 /Game/2DSideScroller/Maps/LevelX.LevelX:PersistentLevel.KOPn_10

this will cause the Property processNP to be nullptred in some objects of type KAi.
I am not sure, but I think this affects only the instances in the current opened map.
what cuase this problem ? how can avoid this?

more info:
type of changes that cause this: not sure, but something like adding new variables, deleting variable, or changing there names …
note that these changes were not applied on property that lost data.

You can avoid hot-relod issues by using an offline building. It works fine as I know

You just have to close UE editor and launch building using Visual Studio instead. To find your VS project (if you don’t know where it is) you can open it from the editor.

217055-msvs.jpg

To build your project using MSVS just use Build->Build solution menu command. Sorry, but I can’t take a screenshot where it is placed, because of different language of my MSVC.

You do not need to close MSVC when opening unreal editor, but it’s important to close editor while building. When building please check MSVC output log for following line:

217056-hotreload.jpg

if it appears it means that UE Editor is still launched and builder is trying to make hot-reload libraries. It can happen even you closed the edtior but it still remains as a process. If this happens you can just cancel building and launch it again later. Maybe there will appear lines like “Old hot reload library ???.dll is removed”. It’s ok, builder just removes an unneccessary hot-reload related junk.

Also you can rebuild project files manually by opening a context menu on your unreal project file and choosing “Generate Visual Studio project files”. It helps if something went completely wrong and you can neither launch an editor nor rebuild your project using MSVC.

Bumping this. I have a similar issue, but no errors and happens only in built game. I have no leads on what caused this but it appeared after engine version upgrade.

Can you please elaborate?

May be saving everything before building will help too. When you save assets and maps UE launches some sort of cleanup cycle first.

thanks for your replies.

to close the editor every time before build may solve the problem but it is not practical.

what I do (when I expect this to happen ) is to change to an empty map before build. then return to the prev map after the build is done. this is annoying, but better than closing the editor.

what is more annoying that I have to check the editor log after every build. when this problem happens when I not expecting, it may cause huge miss that takes long time to fix. the worst case is when I don’t notice that this happened, and delete editor log, then discover that many things are broken :frowning: .

Update: finally I managed to regenerate this on an empty project.
but it was random. now I am trying to regenerate it based on clear steps!

tried save all in the editor and also in visual studio before build, but didn’t solve it.

Update: I have posted a bug report with steps to reproduce the bug, on empty project, here:

I ran into this issue today. I think I found the fix.

The problem is that I used a C++ class which has a blueprint which inherits from it. Within the C++ class, several weeks ago I had created a set of scene capture components with the names, “Cam1, Cam2, Cam3, Cam4”. Later on, I deleted these variables and forgot about it.

Today, I created new scene capture components and I used “Cam0, Cam1, Cam2, Cam3” as variable names. Only “Cam0” worked, the other variables got nulled. I think what’s happening is that just because I remove or rename a variable in C++, it does not mean that it is actually removed from the blueprint. The variable just gets a TRASHED_xxx prefix. So, if you reuse an old variable name in C++, even if its new, it collides with the old variable name and the engine trashes it.

My work around is to rename my variable to “CamA, CamB, CamC, CamD” and this works with no problems.

I haven’t tried it yet, but creating a new blueprint from scratch should also resolve the issue.

3 Likes