Hot reload blueprint reinstancing issue

I’ve found a bug on 4.16 that seems to be a regression with relation to hot reload. These are the steps to reproduce it:

  • Create an empty C++ project
  • Create in C++ a UCLASS that extends APlayerController
  • Create in C++ a UCLASS that extends AGameModeBase
  • Compile
  • Create a Blueprint object that extends your C++ Game Mode class
  • Set the default player controller for that blueprint object as your own APlayerController subclass. Save
  • Create a level and set that game mode as the default game mode for that world. Save
  • Go back to C++, and add a UPROPERTY (can be anything) to both classes you created
  • Hit compile on the editor
  • When the code finished compiling and hot reloading, check the blueprint game mode class. The default player controller will be set to None instead of your C++ PlayerController subclass

This only happens if both the game mode and player controller changed their properties (needing to be reinstanced) in the same compilation

humble bump

Hi waneck,

Sorry for not looking at this sooner. I was able to reproduce the issue in 4.16.2, as well as in 4.15.3, so I don’t believe it is a regression. I was able to find an existing ticket (UE-37694) that may be talking about what is going on here. In order to verify that is the case, could you provide the exact names that you are using for the new APlayerController and AGameModeBase classes that you are creating at the beginning of your repro steps?

If the name of your AGameModeBase class would come before the name of your APlayerController class alphabetically, could you please try the same repro with names that would have the APlayerController class come first alphabetically and see if you get the same result?

I have the same issue in 4.20. After hot-reloading, it says “failed to resolve archetype object”. Once that happens the blueprint is somehow corrupt and I have to rollback. Appears to be unfixable for me.