Description

If dynamic bindings are being used in a custom code class from which Blueprints are derived, any hot reload will make the bindings a permanent part of the Blueprint and they cannot be removed or changed after the hot reload.

Steps to Reproduce
  1. Create a new code project using the First Person template, no starter content.
  2. Add the NewMainPawn header and code files from the attached TestAssets.zip file.
  3. Right-click on the project's .uproject file and generate project files.
  4. Open the project solution in Visual Studio.
  5. In the NewMainPawn.cpp file, change the first include line to include the correct project header file.
  6. Build the project in Visual Studio.
  7. Double-click on the project's .uproject file to open the project in the Editor.
  8. Create a new Blueprint derived from NewMainPawn.
  9. Open the Blueprint and uncheck the Hidden in game option for the capsule component and all three sphere components.
  10. Adjust the scale for each sphere component so they are easily distinguishable from each other.
    • I used 5.0, 10.0, and 15.0.
  11. Place an instance of the new Blueprint into the level.
  12. Start PIE.
  13. Run through the center of the pawn instance.
    • You will see four different messages displayed on the screen, one for each sphere component plus the capsule component.
  14. Stop PIE.
  15. With the Editor still open, add a new variable to the project's character class header file.
  16. Build the project in Visual Studio to trigger a Hot Reload.
  17. Close the Editor.
  18. In the NewMainPawn.cpp file, comment out or delete the following lines of code:
    CameraCapsule->OnComponentBeginOverlap.AddDynamic(this, &ANewMainPawn::OnCollide);
    MultiplierSphere->OnComponentBeginOverlap.AddDynamic(this, &ANewMainPawn::OnMultiplierCollide);
    InnerPointSphere->OnComponentBeginOverlap.AddDynamic(this, &ANewMainPawn::OnInnerPointSphereCollide);
    OuterPointSphere->OnComponentBeginOverlap.AddDynamic(this, &ANewMainPawn::OnOuterPointSphereCollide);
    
  19. Build the project in Visual Studio.
  20. Double-click the project's .uproject file to open the project in the Editor.
  21. Start PIE again.
  22. Run through the center of the pawn instance again.

RESULT:
The same four messages are displayed again.

EXPECTED:
No messages are displayed.

WORKAROUND:
Replace any affected Blueprints with a new Blueprint made from the code class. This will only work if the new Blueprint is created after the hot reload is performed. Simply removing a Blueprint from the level and replacing it with a new instance of the old Blueprint will not work.

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

Won't Fix
ComponentUE - Foundation - Core
Affects Versions4.7.34.84.154.23
CreatedMar 26, 2015
ResolvedAug 18, 2021
UpdatedAug 18, 2021