I’m storing a ‘LastStartTime’, however the DataTable is saving that variable and I don’t want it to. It’s currently not a UPROPERTY() but saves regardless, I’ve tried marking it as a UPROPERTY and also with Transient parameter, but nothing seems to stop it saving the value.
For now I can call an initialize function when the struct is constructed, but I’d rather know the proper way of preventing this.
Here is a trimmed version of my struct with the relevant code.
USTRUCT(BlueprintType)
struct FMeshFX : public FTableRowBase
{
GENERATED_BODY()
FMeshFX(FName InName, bool InLooping, float InCooldown, TArray<UStaticMesh*> InMeshes, TArray<int32> InFrames)
: Name(InName)
, Cooldown(InCooldown)
, CurrentCooldown(Cooldown)
, Variation(0.f)
, LastStartTime(0.f)
{}
FMeshFX()
: Name(NAME_None)
, Cooldown(0.f)
, CurrentCooldown(0.f)
, Variation(0.f)
, LastStartTime(0.f)
{}
bool CanDoNextLoop(float CurrentTime) const
{
return CurrentTime >= LastStartTime + CurrentCooldown;
}
FName Name;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Effect)
float Cooldown;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Effect)
float Variation;
float CurrentCooldown;
float LastStartTime;
};