Hot Reload makes changed C++ classes unknown

Sometimes, if you have a blueprint that inherits from a custom created C++ class (deriving eg from AActor) and changes are applied to this class. Then after a Hot Reload, the BP can no longer be saved and starts saying it has a reference to unknown or locked external type ACustomClass_HOTRELOAD or something similar. After a restart of editor, opening the Bp will crash Unreal. Rebuilding from code makes no changes either.

Something similar happens for custom components. When creating a custom component, they appear with the name UCustomComponent_HOTRELOAD in the component dropdown list of the blueprint. Casting to your custom component fails in code after a hot reload. Probably because the type is no longer UCustomComponent but UCustomComponent_HOTRELOAD.

Hi simmania,

I tried to reproduce this in 4.6.1, but was not able to do so. Would you be able to provide some additional information?

  • What version of the Engine are you using, and are you using the binary version installed by the Launcher, or did you build the Engine from source code?
  • Do you recall what kinds of changes you had made to the custom class just prior to this issue occurring?
  • Did the issue with components occur when they were first created?

Hi .

  • 4.6.1
  • simple changes such as adding variables in such way that remapping of class at hot reload is necessary!!
  • No, it happens on HotReload. Closing editor, compile from VS and open Editor again will make the types known again.

I very much think this issue is related to 2 other posts I have posted earlier to which you have not answered on my new comments.

HotReload seems to change types such that ‘many’ things go wrong:

  • Serialize to file with PerObjectCongfig
  • Custom components in blueprints appear with different name, eg ComponentName_HOTRELOADED_0 etc.
  • Ambiguous warnings are posted from Unreal at runtime where it shows the original name + ComponentName_HOTRELOADED_XXX etc.
  • Cast in code fails

See also my other posts on this. This is probably all very much related to hotReload changing the actual type in memory.

Hi simmania,

Thank you for the additional information that you provided. I was able to reproduce the error message that you described, but was not able to make the Editor crash. However, I suspect that resolving the cause of the error message will also resolve the cause of the crash that you experienced. I have submitted a report of what I saw to have this investigated further (UE-10163).

Hi simmania,

I just wanted to provide a quick update here. I was notified that the ticket I had submitted for this issue had been fixed and, after waiting for some additional hot reload fixes to be put in place, I ran my test again in our latest internal build. The error message stating that the Blueprint cannot be saved no longer appeared. If you have built the Engine from source code, you can find the commit containing the fix for this issue here. If you are using the binary version installed through the Launcher, the fix will be included in a future release version of the Engine.

As I mentioned, there has been some work done recently to improve hot reloading specifically. You should see some improvements in this area in future versions.