Hi All. Here is the scenario. I have an AActor which I like to show some special static mesh component and text render components for in editor only. Basically the Actor has an array of FVectors that can be manipulated in the editor and for each point in that array I create a static mesh component and text render component (for visualization).
The problem comes in when the actor gets duplicated via alt+drag or copy+paste. Upon duplication, the new actor has all of the static mesh and text render components as the original actor but then when I go to move one of the points in the new actors’ array the “old” static mesh and text render component linger in the editor view. If I reload the level OR recompile the parent blueprint of the actor then those old static mesh and text render components are removed. Any ideas on why this might be happening?
In order to refresh the static mesh and text render components I am hooked into PostLoadSubobjects
and PostEditChangeProperty
. The logic of these functions is that I destroy my array of static mesh and text render components and then recreate based off of the array of FVector data on the class, so don’t think there’s any issues there.
I have posted a series of images. The first image shows that I have duplicated the actor (new actor is selected). The second image shows that I have now manipulated one of the duplicated actors’ points and you can see two static mesh and text render components (bad state). The third image shows what happens after reloading the level and/or recompiling the parent blueprint, the old static mesh/text render component has been removed (good state, what I would have expected in image 2 if everything was working correctly).
Thanks.