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:
      struct 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

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.

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.

Login to Vote

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