Hi there, I have a very simple C++ class which I wish to be able to tweak one of the properties in (is that the right C++ term?) in the Editor. If I change the value in the editor, however, it does not change within the class.
Here is the relevant code from my test class:
.h
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Damage")
int32 TotalDamage = 5;
.cpp
AMyActor::AMyActor()
{
UE_LOG(LogTemp, Warning, TEXT("Total damage in constructor %d"), TotalDamage);
}
void AMyActor::PostInitProperties()
{
Super::PostInitProperties();
UE_LOG(LogTemp, Warning, TEXT("Post init %d"), TotalDamage);
}
If I change the Total Damage in the Editor to 10 I’d expect to see something like:
Total damage in constructor 5 (not sure the variables have been updated by the editor value at this stage - could be wrong though!)
Post init 10
But I dont. I see:
Total damage in constructor 5
Post init 5
I’m sure I’m being dense somewhere - have I just not understood how this works?
Many thanks (and apologies if this appears as a repost, I’m having one of those days
)