I just tested this with 2000 instanced meshes but I couldn’t get your result. How are you spawning the meshes in (construction script,event graph, etc) and how many are spawning at once?
If the “Add static Mesh component” node is set to NONE in the mesh then it will crash!
Double Edit Nope, still happens just not every time. Ah well hehe.
I have my level split up into chunks, and each chunk handles around 3-4k instances. I’m spreading out the spawning a chunk at a time, my logic waits for one chunk to complete and then moves to the next.
It seems to crash at different times each time but I definitely can get the first few chunks spawned in ok. There are probably upwards of 50k instances in the level by the time it crashes (in 2-3k chunks -no single instanced static mesh is spawned in numbers larger than 3k or so). They spawn in like a champ if set to movable so I don’t think my setup is doing anything inordinately taxing other than whatever is causing this crash.
I happened on this crash while troubleshooting a collision performance issue - I was curious if static movement might make collison on instances more performant. Curious to hear if that is a possibility - if not then I’ll put this on the back burner for now and investigate another approach.
As always, thank you for your help!
Here’s the bit of logic I loop through inside each chunk to generate the instances:
When a mesh is set to Static, the collision doesn’t have any effect on performance. It becomes more performant because in no longer has to calculate physics and the lighting is handled differently.
From what you described it sounds like you are spawning the meshes in at run time. Run time objects must be set to Movable. If you would like them set to Static you will need to spawn them in before run time via the construction script.