# Instanced Static Mesh, Removing Instance Issue

**URL:** <https://forums.unrealengine.com/t/instanced-static-mesh-removing-instance-issue/66187>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [June 10, 2016, 8:22pm UTC](https://forums.unrealengine.com/t/instanced-static-mesh-removing-instance-issue/66187 "2016-06-10T20:22:49Z")\
**Posts on this page:** 1\
**Showing post:** 32

<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:** [September 28, 2023, 5:48am UTC](https://forums.unrealengine.com/t/instanced-static-mesh-removing-instance-issue/66187/32 "2023-09-28T05:48:29Z")

</div>

Depending on what you’re doing, if the indexing order is paramount, instead of removing instances, move them. Move them where we cannot ever find them, under the carpet they go.

You can also add the indexes to an array fitst and then batch remove them from HISM. Example:

> [@Reverse for loop not removing isntances.](https://forums.unrealengine.com/t/reverse-for-loop-not-removing-isntances/486430/5):
>
> If you remove an index, some other indexes will be redistributed - jumbled. It does not matter here that you’re doing it in reverse - the indexing within the HISM does not work like a regular array where elements are neatly ordered; they cannot be discarded / (re)moved around while others keep their spot. You cannot have a situation where there is no index 5 in HISM with 10 instances. The moment you remove 5, number 8 may become 6. expressionless If you want to remove a bunch of indexes, add…

Removing them with a for loop one-by-one is not a thing since the order gets jumbled, as you said.

> I wasn’t able to find the info anywhere on forums

> [@HISM index problem](https://forums.unrealengine.com/t/hism-index-problem/499183/2):
>
> I think it’s index of instance, and it auto-increment, but some time, like after removing instance many times, the return value may go low like 0 or 23, which the instance I already removed, why? HISM indexes must live in a continuous ordered unique list. If you make a hundred, they’ll be ordered from 0-99. If you remove the 25th, another instance with a higher index will take its place and lose its own index! From an older thread of mine: Note what happens to indexes when a random instanc…

---

_[View the full topic](https://forums.unrealengine.com/t/instanced-static-mesh-removing-instance-issue/66187)._
