Description

When a struct is created in the header file for a class, and the struct contains a member that is of that class' type, performing a hot reload after changing the class will result in a Blueprint derived from that class and using that struct having compile errors. The errors can be resolved by closing and re-opening the Editor.

Steps to Reproduce
  1. Create a new project.
  2. Add a new Actor class to the project.
    • Use the name MyActor for the new class.
  3. Add the following code to the header file for the new class between the #include lines and the class definition:
    class AMyActor;
    
    USTRUCT(BlueprintType)
    struct FActionData
    {
    	GENERATED_USTRUCT_BODY()
    
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Action Data")
    	FVector Point;
    
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Action Data")
    	AMyActor* Unit;
    
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Action Data")
    	AActor* Actor;
    };
    
  4. In the class definition, add a member that is of the struct type:
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "TestCat")
    FActionData TheData;
    
  5. Build the project in Visual Studio.
  6. Open the project in the Editor.
  7. Create a Blueprint that derives from MyActor.
  8. In the Blueprint's Event Graph, create a setup similar to what is shown in the Works.png image.
  9. Add a new UPROPERTY to the MyActor class.
  10. Build the project in Visual Studio to trigger a hot reload.

RESULTS:
The build completes successfully, but the Blueprint's Event Graph now looks like the Broken.png image.

EXPECTED:
The build completes successfully and the Blueprint has no errors.

WORKAROUND:
Close and re-open the project in the Editor.

Have Comments or More Details?

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

5
Login to Vote

Won't Fix
ComponentUE - Gameplay - Blueprint
Affects Versions4.8.34.9.14.11
CreatedSep 16, 2015
ResolvedAug 18, 2021
UpdatedAug 18, 2021
View Jira Issue