Hi there. I'm not sure if this is the right section, but here goes.
I'm trying to modify some of the variables inside a struct array I made. I loop through the array with a foreach loop but it doesn't seem to do anything, even when I hide unnecessary pins.
I thought maybe the Set Members in Struct function was not working, so I made my own functions to set members:

This is the struct I made:
However, even after using those functions, the value printed on screen is still 0.2, which doesn't make much sense. Am I doing anything wrong?
I'm trying to modify some of the variables inside a struct array I made. I loop through the array with a foreach loop but it doesn't seem to do anything, even when I hide unnecessary pins.
I thought maybe the Set Members in Struct function was not working, so I made my own functions to set members:
Code:
void AMainCharacter::SetRecharge(FCommand NCommand, const float Time) { NCommand.currentRechargeTime = Time; } void AMainCharacter::SetTotalRecharge(FCommand NCommand, const float Time) { NCommand.maxRechargeTime = Time; }
This is the struct I made:
Code:
USTRUCT(Blueprintable) struct FCommand { GENERATED_USTRUCT_BODY() UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Commands") int32 ID; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Commands") FText CommandName; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Commands") TEnumAsByte<ECommandType> Type; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Commands") UTexture2D* CommandIcon; //Base damage or recovery dealt by the command. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Commands") int32 BaseDamage; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Commands") TEnumAsByte<EElement> CommandElement; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Commands") float ElementPercentage; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Commands") float currentRechargeTime; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Commands") float maxRechargeTime; FCommand() { BaseDamage = 0; maxRechargeTime = 1000; currentRechargeTime = 0; } };
However, even after using those functions, the value printed on screen is still 0.2, which doesn't make much sense. Am I doing anything wrong?
Comment