I am constucting an instanced grid (much like the youtube video from the ue4 guy). But rather I’m doing it in C++ using the OnConstruction method.
This functions fantastically! But it seems to get called more than just whenever something changes (even when i just selecting it in scene outliner).
I’m just curious if there is best practice for say, checking if any properties are dirty on my object, so that i know i don’t have to rerun the construction logic. Also what is interesting is that i have to clear instances from my instanced static mesh component, since recalling construction doesn’t reset components. Clearly there is a small bullet list of “best practice” that i need to be aware of.
If you want construct just once, PostInitializeComponents is good
If you want object to react on invidual property chages in editor use PostEditChangeProperty
You can GetName() the UProperty argument in struct in that event to change somethign more specificly
But if you want object to update according to variables durring gameplay (PostEditChangeProperty work only in editor), use tick. You can make common function for both OnConstruct and Tick and call same function in both.
Also worth to notice, C++ does not detect variable changes, any raw setting operator change variable in memory directly without informing anyone, so if you want some update on set from C++, create Set function of variable.