Hierarchical Instanced SM Crashing and Best practices.

Hello

ISSUE: I want to quickly and Cheaply(performance wise) decorate my level using meshes (wooden planks)

My Approach: I created an actor with a HISM component, as well as some instance-editable variables, then in the construction script used those variables to generate a grid of planks.
I also included a editor function to save the transforms of each ISM in an array, as well as to prevent the Construction script from being called every time the actor is moved.
The actor works as intended, each grid is persistent across rebooting the editor/changing levels

THE ISSUE: however, For some reason, when running the game in editor, the entire editor will crash after roughly a minute of walking around a level using ~7 of these actors.

I’m unable to access memory insights and so lack evidence, but the game ceases to crash when setting the HISM to “hidden in game” which leads me to believe that the HISM is causing the memory issue

Does anyone know why this is happening? Is there a “best practices” policy that I am unknowingly violating by using HISM in this manner?
I can post additional pictures if needed.



(to the right are the nodes that randomize each SM’s rotation/set location)

It would be handy to see the whole of both scripts.

The function Used AFTER generating the mesh grid

The construction script is far larger, apologies for the pics
(CS posted by anonymous | blueprintUE | PasteBin For Unreal Engine)
The inside of the “Randomize rotation” node (used to prevent identical tile orientations)

If you need a bigger pic or more info, lmk

Is it perhaps because the construction script is being called during runtime? i assumed that my “CURRENTLY FINISHED” bool would prevent the CS from executing at runtime, is this not the case?

Bumping, this issue is very important to me, If anyone has any advice at all I’d greatly appreciate it

Sorry, I only stumbled on this again just now. It’s good to use the reply button :slight_smile:

I think you’re maybe trying too hard with the stored transforms stuff. If you want to stop the constructor running every time you move the blueprint, you can just use a bool like this

( and the rest after the SET node ).

The constructor is not used at runtime.

Thanks for the response!
My issue isn’t that the constructor runs when I don’t want it to. (I’m already using a similar bool)
The issue is that while playing the game in editor, the entire editor will crash after only a few minutes or so. Like I mentioned in the first post, I don’t know for sure if the HISMs are causing the crash, but I DO know that the game ceases to crash when the HISM’s are set to “not visible”

My main question is on what performance issues exist in my current script? is it something to do with how I generate/save each Instanced mesh?

Like I say, it might well be something to do with that, and you don’t need to do that to stop the constructor running. The bool is enough.