Description

When the default values of a struct are set in code and an array of the struct type are added as a class variable, creating a blueprint of the class with show array elements with the "reset defaults" arrow regardless of the current/default value.

Steps to Reproduce
  1. Open UE4 Editor (any project)
  2. Add code to project based on actor (MyActor)
  3. Save all and close editor
  4. Add the following to MyActor.h
    • Above UCLASS() macro:
      USTRUCT(BlueprintType)
      struct FMyTestStruct
      {
      GENERATED_USTRUCT_BODY()
      FMyTestStruct()
      {
      	Anum = 45.234;
      	Abool = true;
      }
      UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
      	float Anum;
      
      UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
      	bool Abool;
      };
      
    • Inside class declaration within the public properties section:
      UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
      	TArray<FMyTestStruct> Astruct;
      
  1. Build Project
  2. Open project in editor
  3. In the editor, add blueprint based on MyActor
  4. In blueprint details panel, click plus button to add element to Astruct array

Result:
Anum and Abool will show the values set in code but will have the yellow arrow indicating the default value has been changed. Clicking the yellow will change the values to 0.0 / false, respectively.

Expected:
Default values are set and editor recognizes them as the default values.

Have Comments or More Details?

Head over to the existingAnswerHub thread and let us know what's up.

9
Login to Vote

Unresolved
ComponentGameplay - Blueprint
Affects Versions4.13.24.144.194.20
CreatedNov 14, 2016
UpdatedFeb 14, 2018