# Changing material on specific instanced static meshes when overlapped by ball

**URL:** <https://forums.unrealengine.com/t/changing-material-on-specific-instanced-static-meshes-when-overlapped-by-ball/647508>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, Blueprint, question\
**Created:** [September 13, 2022, 6:15am UTC](https://forums.unrealengine.com/t/changing-material-on-specific-instanced-static-meshes-when-overlapped-by-ball/647508 "2022-09-13T06:15:51Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![D\_Deng](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/d_deng/32/758117_2.png) [@D\_Deng](https://forums.unrealengine.com/u/D_Deng)\
**Post date:** [September 14, 2022, 2:19am UTC](https://forums.unrealengine.com/t/changing-material-on-specific-instanced-static-meshes-when-overlapped-by-ball/647508/7 "2022-09-14T02:19:34Z")

</div>

I’ve found the answer in another forum post:

> [@Get overlapping index of Hierarchical instanced static mesh](https://forums.unrealengine.com/t/get-overlapping-index-of-hierarchical-instanced-static-mesh/461890/3):
>
> I tried breaking the hit result, and it just returns -1. Constantly line tracing would just defeat the point of using a HISM

They’ve used hierarchical static meshes but it also works for instanced static meshes. It still needs a bit of fine tuning but the effect is there.

Code for reference:

 ![Capture](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/f/1/4f1470a6a50cfa1f01b1b86adc3c1f8717836215.png)

---

_[View the full topic](https://forums.unrealengine.com/t/changing-material-on-specific-instanced-static-meshes-when-overlapped-by-ball/647508)._
