# Nested for loop to spawn HISM causes crash

**URL:** <https://forums.unrealengine.com/t/nested-for-loop-to-spawn-hism-causes-crash/598845>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, Blueprint, question\
**Created:** [July 7, 2022, 1:54am UTC](https://forums.unrealengine.com/t/nested-for-loop-to-spawn-hism-causes-crash/598845 "2022-07-07T01:54:00Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [July 7, 2022, 10:11am UTC](https://forums.unrealengine.com/t/nested-for-loop-to-spawn-hism-causes-crash/598845/4 "2022-07-07T10:11:06Z")

</div>

> [@PerCat](#):
>
> How do you do it “by frame”? Isn’t tick frame dependent already?

It does not matter. Each tick you spawn some (thousands) of HISMs, this will go as fast as it can while still maintaining a degree of responsiveness. You can set the tick to any value anyway. This was just a test to see if we can go above 1m, we absolutely can provide we spread the spawning over time and not force the engine to create too many in a single tick.

You could use a timer but then we will not go _as fast as we can_ - it will be more controlled, though.

> Is there an upper limit of how many HISMs UE can actually handle?

Probably. But the idea is to spawn chunks around the player and then get rid of them when they move away.

* * *

I am assuming you’re familiar with:

> [@UnrealVoxel - blocky Minecraft-like infinite world + download](https://forums.unrealengine.com/t/unrealvoxel-blocky-minecraft-like-infinite-world-download/66327):
>
> Hey everyone, I want to share with You my version of voxel based Minecraft-like infinite world. I wasfocused more on C++ instead of BP to get the best performance possible. I create only the front faces from the outward voxels. I even manage to remove the chunk connections using the additional information shared between chunks. Two weeks ago You could follow creation process on my twitch channel ([http://twitch.tv/](http://twitch.tv/)) where I did almost everything from algorythmic point. During last two weeks I w…

---

_[View the full topic](https://forums.unrealengine.com/t/nested-for-loop-to-spawn-hism-causes-crash/598845)._
