I have a custom struct that I’ve made in C++. Most of the properties are editable in the editor, but a couple of them are derived from calculations made on some of the user-entered values. I can get these values to calculate fine in the constructor, but I need them to update when the dependent values are changed in the editor. I am trying to use code that is suggested to do this for classes (from this page), but it’s not working.
Here’s what I’m trying:
void CalculateValues()
{
ThinningSpeedRange = ThinningSpeedMax - ThinningSpeedMin;
}
#if WITH_EDITOR
void FBrushSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
CalculateValues();
Super::PostEditChangeProperty(PropertyChangedEvent);
}
#endif
Is there a different approach to doing this when working with structs?