Why is PostEditChangeProperty not called for my custom AActor ?

Hi,

I guess I still don’t understand some issues about the UPROPERTY system.
I have the following setup:

  • A custom AActor derived class (let’s call it ClassA) declaring a few UPROPERTIES and overriding PostEditChangeProperty()
  • Another custom AActor derived class (let’s call it ClassB) spawning an instance of ClassA using GetWorld()->SpawnActor<ClassA>(SpawnParameters) in its OnConstruction-method and assigning the property just after it has been spawned

However ClassA::PostEditChangeProperty is not called. Why is that ? I don’t get it. :frowning:

Can somebody explain ?

PostEditChangeProperty is only called when a property is changed via the Editor. It will not be called when the actor is spawned.

ah ok. that’s different than i thought and yields weired behaviour at times.
for example I can assign ForcedLodModel on a StaticMeshComponent which won’t work, but using the SetForcedLodModel method works. It’s weired that I can assign things in code, which subsequently have no effect, because the system wont send the notification of that change.

Oh well. At least I understood it now, I think.

Thank you.