USTRUCT(Blueprintable)
struct FMyStruct
{
GENERATED_BODY()
// default constructor -- without parameters, so it will work inside other structures
// that need default initializer, such as TArray
FMyStruct()
: MotherNanny(TEXT("")), KeyRing(TEXT("")), Scones(-1.f)
{}
// constructor that takes 3 parameters
FMyStryct(const FName& InMotherNanny, const FName& InKeyRing, float InScones)
: MotherNanny(InMotherNanny), KeyRing(InKeyRing), Scones(InScones)
{}
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Struct")
FName MotherNanny;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Struct")
FName KeyRing;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Struct")
float Scones;
};
Thanks! So from what I understand, a struct constructor is like the name implies, a constructor that runs when the struct constructed, and sets the struct’s variables based on what was passed to the constructor.