# Attempting to remove several instanced static meshes on box trace, some remain on final hit trace.

**URL:** <https://forums.unrealengine.com/t/attempting-to-remove-several-instanced-static-meshes-on-box-trace-some-remain-on-final-hit-trace/2726085>\
**Category:** Blueprint\
**Tags:** arrays, unreal-engine, Instanced-Mesh, Array, question, Blueprint\
**Created:** [June 3, 2026, 4:07pm UTC](https://forums.unrealengine.com/t/attempting-to-remove-several-instanced-static-meshes-on-box-trace-some-remain-on-final-hit-trace/2726085 "2026-06-03T16:07:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flyin\_Guy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Flyin\_Guy](https://forums.unrealengine.com/u/Flyin_Guy)\
**Post date:** [June 3, 2026, 4:07pm UTC](https://forums.unrealengine.com/t/attempting-to-remove-several-instanced-static-meshes-on-box-trace-some-remain-on-final-hit-trace/2726085/1 "2026-06-03T16:07:59Z")

</div>

I am attempting to make a mining mechanic in unreal engine 4, that is similar to minecraft. I am attempting to remove multiple instances from an instanced static mesh using a box trace to detect the blocks, and apply damage. The damage seems to be applied evenly, but when removing the instances when they run out of health, some instances seem to be left. I have attached a screenshot of my box trace. Why are some instances remaining when they should be evenly removed?

 ![theproblem2.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/d/1/bd18dacf84591effe26abfef3b38e0c4127dbb40.jpeg)

 ![theproblem](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/3/c/23c62661ae858024ea544a9bc06c83027f459345.png)

![miningBug](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/d/f/bdf9e788b77e79aefd747cb9c60e79e6129b2620.gif)

---

<div class="post-metadata">

**Author:** ![Flyin\_Guy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Flyin\_Guy](https://forums.unrealengine.com/u/Flyin_Guy)\
**Post date:** [June 3, 2026, 5:02pm UTC](https://forums.unrealengine.com/t/attempting-to-remove-several-instanced-static-meshes-on-box-trace-some-remain-on-final-hit-trace/2726085/2 "2026-06-03T17:02:13Z")

</div>

I managed to solve this with help from another thread linked bellow

> [@Instanced Static Mesh, Removing Instance Issue](https://forums.unrealengine.com/t/instanced-static-mesh-removing-instance-issue/66187/12):
>
> If I may chime in, I too had issues removing the correct instances but this relatively simple setup solved it for me: Explanation: The Int Array stores the indexes we wish to remove. Since removing a lower number will make the instances go down one position, we remove them from highest to lowest. We store the values that Max Of Int Array returns so we don’t have to run that function over and over (well, twice, instead of thrice). After removing the returned Max Value, …

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [June 3, 2026, 6:03pm UTC](https://forums.unrealengine.com/t/attempting-to-remove-several-instanced-static-meshes-on-box-trace-some-remain-on-final-hit-trace/2726085/3 "2026-06-03T18:03:36Z")

</div>

Yup you have to sort your instance first, then remove.

This applies to all Instancing.
