I have a component which I have added to a BluePrint actor. I need to perform initialisation, in the component, based on settings that have been set and on geometry that it references.
Doing this in the C++ Constructor doesn’t work because I find the pointers to the assets are all NULL.
I was doing the initial set up in OnComponentCreated which allowed me to perform my own processing. However this seems to have mysteriously, recently, stopped being called in game. The constructor is still called though.
When I edit the Blueprint, changing values, or switching things on or off, then I see the constructor is called and then OnComponentCreated is called successfully.
However if I PIE then the constructor is called but the OnComponentCreated method is never called. This means that the game crashes because the component is not set up correctly.
Is there something, somewhere, I need to click to ensure OnComponentCreated is always called after creation? Switching “Auto Activate” on or off in the component seems to have no effect.