Components losing state?

I’m trying to calculate something in a UActorComponent after it has been edited (PostEditChangeProperty), but the component’s constructor keeps getting called (clearing the data) when the change happens in the editor.

Is this a bug, or is there somewhere else I can make the calculations post-edit?

Hi Grogger,

Could you provide a little more information about what you are trying to accomplish and how you are doing it? Are you creating a custom ActorComponent?

One thing I would like to point out is that any time you change a Blueprint in the Editor, it gets destroyed and recreated, so the constructor will be called every time. When playing the game, the constructor will only be called once when the Blueprint is initially created.

Hi ,

I was creating a custom UActorComponent and I wanted to recalculate a subcomponent when I changed a value in the editor.

I ended up finding OnRegister and I’ve placed my recalculations in there, which seems to work well.

Thank you for confirming that this is intended behavior :slight_smile: