Update component TArray after editor changes
Hey guys! I'd like to update a TArray with the right number of UInstancedStaticMeshComponent when I change a value in the details panel.
For now, I can get the TArray to be initialized with the expected number of components when we look at the default values assigned to variables in the header. But then, when I change the values of those same variables in the editor, the TArray of components is not updated accordingly. Here is some code:
So, in this case, I obtain an array with 8 UInstancedStaticMeshComponents. Nothing happens when I change the value in-editor. I believe for something to happen I'd need to add something to the OnConstruction script. I tried to create the components similarly in that function but I couldn't find a way to make it work without crashes. Any pointers or tips?
asked Jun 02 '18 at 05:19 AM in C++ Programming
I had a similar problem recently. You need to implement the PostEditChangeProperty event. Then you should be able to handle variable changes in the editor. https://answers.unrealengine.com/questions/252811/how-do-i-use-posteditchangeproperty.html
answered Jun 02 '18 at 10:26 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here