# Get material from GetMaterialFromCollisionFaceIndex

**URL:** <https://forums.unrealengine.com/t/get-material-from-getmaterialfromcollisionfaceindex/464521>\
**Category:** Rendering\
**Tags:** hit-result, unreal-engine, Blueprint, question\
**Created:** [May 1, 2020, 4:04pm UTC](https://forums.unrealengine.com/t/get-material-from-getmaterialfromcollisionfaceindex/464521 "2020-05-01T16:04:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bitwaker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bitwaker](https://forums.unrealengine.com/u/Bitwaker)\
**Post date:** [May 1, 2020, 4:04pm UTC](https://forums.unrealengine.com/t/get-material-from-getmaterialfromcollisionfaceindex/464521/1 "2020-05-01T16:04:06Z")

</div>

I’m obtaining the material that corresponds with the face hit by a LineTrace using the node `GetMaterialFromCollisionFaceIndex`. This node is very useful but as a result of the call I’m getting a `Material Interface Object Reference`… how could I convert this type to a normal material and verify if it is equal to another material?

What I’m trying to do is to trace a line through an object and verify if the line is hitting a specific material (I prefer not to use a psx material and the node described above since to be perfect for what I’m looking for)

---

<div class="post-metadata">

**Author:** ![Bitwaker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bitwaker](https://forums.unrealengine.com/u/Bitwaker)\
**Post date:** [May 1, 2020, 4:36pm UTC](https://forums.unrealengine.com/t/get-material-from-getmaterialfromcollisionfaceindex/464521/2 "2020-05-01T16:36:37Z")

</div>

I think I’ve found a quick solution. Actually a simple Cast To Material Instance seems to work without any issue.
