Description

Performing a Hot Reload after changing some properties in a custom Static Mesh Component code class from public to private appears to reset the static mesh set for any Pawn Blueprints that use that custom component. This only seems to happen with Pawn Blueprints. The behavior was not observed in an Actor Blueprint, and other types of Blueprints were not tested.

REGRESSION:
Yes. This behavior did not seem to occur in 4.19.

Steps to Reproduce
  1. Create a new Basic Code project.
  2. Add a new custom StaticMeshComponent class to the project.
  3. Add the following UCLASS specifiers to the new class: UCLASS(Blueprintable, BlueprintType, meta = (BlueprintSpawnableComponent))
  4. Add a public property to the new class of any type
    • eg:
      public:
      	UPROPERTY(EditDefaultsOnly, Category = TestCat)
      	float TestVar;
      
  5. Build the project in Visual Studio.
  6. Open the project in the Editor.
  7. Create a new Blueprint that derives from Pawn.
  8. Add one of the new custom StaticMeshComponents from step 2 to the Blueprint and set it as the root component.
  9. Set the Static Mesh property in the component using any static mesh (test was performed using the Cone static mesh from the Engine).
  10. Place an instance of the Pawn Blueprint into the level.
  11. Save the level and set it as the default game and Editor startup level.
  12. In Visual Studio, change the property from step 4 from public to private.
  13. Build the project in Visual Studio to start a Hot Reload.
  14. When the Hot Reload completes, reload the level
    • This can be done by double-clicking the level in the Content Browser.

RESULT:
The static mesh set in the pawn's static mesh component disappears from the level. If the Pawn is selected in the level and the static mesh component is selected in the details panel, the static mesh property has been reset to "none".

EXPECTED:
The static mesh property remains the way it was set in the Blueprint.

WORKAROUND:
Do not perform a Hot Reload when changing properties in a parent class from public to private. If a Hot Reload is performed, closing and re-opening the Editor appears to put the Pawn Blueprint back the way it is expected to be.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-63298 in the post.

94
Login to Vote

Won't Fix
ComponentUE - Gameplay - Blueprint
Affects Versions4.20.14.21
CreatedAug 24, 2018
ResolvedAug 18, 2021
UpdatedAug 18, 2021
Pull Requests
5830 - Algorithman