# HISM, LineTrace, Material, Where and What am I doing wrong

**URL:** <https://forums.unrealengine.com/t/hism-linetrace-material-where-and-what-am-i-doing-wrong/1941643>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [July 18, 2024, 9:35am UTC](https://forums.unrealengine.com/t/hism-linetrace-material-where-and-what-am-i-doing-wrong/1941643 "2024-07-18T09:35:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dylan\_XMas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dylan\_XMas](https://forums.unrealengine.com/u/Dylan_XMas)\
**Post date:** [July 18, 2024, 9:35am UTC](https://forums.unrealengine.com/t/hism-linetrace-material-where-and-what-am-i-doing-wrong/1941643/1 "2024-07-18T09:35:34Z")

</div>

Hello Everyone,

I am trying to use HISM, creating a grid with many meshes,  
linetracing a few of them and changing the material for the ones hit.

Problem : The linetrace is (I think at least) working well, it detect a meshes with a Index != -1  
but the “changing the material” isn’t working.

I tried to follow :

> [@Changing material on specific instanced static meshes when overlapped by ball](https://forums.unrealengine.com/t/changing-material-on-specific-instanced-static-meshes-when-overlapped-by-ball/647508/8):
>
> Nah. Your research is spot on. It’s a good method, performant but somewhat tricky to set up right. I’ve found the answer in another forum post: It’s hard to tell (for me) what would be more efficient - a multibody overlap or a physical hit. I’d say the latter would be faster but it might as well be in the ballpark of negligible difference. Things can be further optimised, too. When it comes to HISM vs ISM - which one to choose would depend on how the levels are designed and the design of t…

(also the link just above the message)

So, step by step :

Grid Creation :

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/0/3/c03b1143765a296dcad5d7530f21bb12efc36295.png)

collision settings :

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/4/de40f9ec5f810dc2d1a3a5eac7c39e57c8b18f80.png)

Linetrace :

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/f/6/bf6018889e56a88fca29aa984618ad92d962c71c.png)

Changing material :

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/1/8/b18cdee2f79a1e4357dc89fbb61b46e4b275b318.png)

With, in HISM param :

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/0/8/a08d3c65e5cf44a6a6496c25d614a0ce580e5697.png)

And Material :

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/c/1/2c13c90e3e08eda1ff8a8a783f57bca103d16cd4.jpeg)

And finally, the test :

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/5/4/55412a7fa169024d4a931082ca4a181a665050fa.jpeg)

As you can see,

1. Why the color of material of HISM isn’t white ?
2. The linetrace hit something with an index (here it’s 3), but the changing material doesnt happen.

---

<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 18, 2024, 1:59pm UTC](https://forums.unrealengine.com/t/hism-linetrace-material-where-and-what-am-i-doing-wrong/1941643/2 "2024-07-18T13:59:20Z")

</div>

• why white? You’re sending 0,0,0 which translates to black  
• flag the last one as dirty

---

<div class="post-metadata">

**Author:** ![Dylan\_XMas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dylan\_XMas](https://forums.unrealengine.com/u/Dylan_XMas)\
**Post date:** [July 19, 2024, 7:41am UTC](https://forums.unrealengine.com/t/hism-linetrace-material-where-and-what-am-i-doing-wrong/1941643/3 "2024-07-19T07:41:33Z")

</div>

Thank You ! The main problem is resolved now

I’m sorry I did not see  
“Is this not working for you? Also, the `dirty` flag should be set for the last instance only”  
In your previous post…

The white problem isn’t but it’s secondary.  
The material is white and I send 0,0,0 only when linetrace hit.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [August 18, 2024, 7:41am UTC](https://forums.unrealengine.com/t/hism-linetrace-material-where-and-what-am-i-doing-wrong/1941643/4 "2024-08-18T07:41:39Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
