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.
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; };
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "TestCat")
FActionData TheData;
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.
Head over to the existing Questions & Answers thread and let us know what's up.
5 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 4.8.3, 4.9.1, 4.11 |
Created | Sep 16, 2015 |
---|---|
Resolved | Aug 18, 2021 |
Updated | Aug 18, 2021 |