# TraceHitInfo returns default Physical Material instead of current

**URL:** <https://forums.unrealengine.com/t/tracehitinfo-returns-default-physical-material-instead-of-current/343712>\
**Category:** Rendering\
**Tags:** Trace, unreal-engine, question\
**Created:** [January 11, 2016, 8:55am UTC](https://forums.unrealengine.com/t/tracehitinfo-returns-default-physical-material-instead-of-current/343712 "2016-01-11T08:55:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frozenfire](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Frozenfire](https://forums.unrealengine.com/u/Frozenfire)\
**Post date:** [January 11, 2016, 8:55am UTC](https://forums.unrealengine.com/t/tracehitinfo-returns-default-physical-material-instead-of-current/343712/1 "2016-01-11T08:55:12Z")

</div>

Apparently TraceHitInfo from all kind of trace returns the default physical material of the material/MIC instead of current Physical Material. This is reproducible by having a Dynamic Material changing it’s physical material during runtime, and then use a linetrace to returns it’s physical material. I’ve tested this both on C++ and blueprint with similar result.

I can confirm that the process ‘changing of physical material’ itself work by printing the current physical material of the material. I believe this had to do with the getSurfaceType function.

---

<div class="post-metadata">

**Author:** ![Lovecraft\_K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lovecraft\_K](https://forums.unrealengine.com/u/Lovecraft_K)\
**Post date:** [January 11, 2016, 5:42pm UTC](https://forums.unrealengine.com/t/tracehitinfo-returns-default-physical-material-instead-of-current/343712/2 "2016-01-11T17:42:02Z")

</div>

Hi Frozenfire -

I was able to replicate the issue internally and have entered a bug report as UE-25200. As we investigate a solution to this issue I will keep you informed here.

Thank You for your assistance tracking this issue -

Eric Ketchum

---

<div class="post-metadata">

**Author:** ![Dig\_Squid](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dig_squid/32/1145423_2.png) [@Dig\_Squid](https://forums.unrealengine.com/u/Dig_Squid)\
**Post date:** [January 12, 2016, 10:31am UTC](https://forums.unrealengine.com/t/tracehitinfo-returns-default-physical-material-instead-of-current/343712/3 "2016-01-12T10:31:04Z")

</div>

I can see that this is confusing, but it is expected at the moment, and I’m not sure of a good way to fix it. The physical material is stored on the collision body, so when you change the PhysicalMaterial on the MID, the body needs to be updated. Unfortunately we don’t have a mapping of all bodies using a particular MID, and updating all of them could be very expensive. The best workaround is probably to call SetMaterial again on the afftected component, which will update the collision info. Or you could manually query the material and then physical material on the object, rather than using info from the HitInfo.

---

<div class="post-metadata">

**Author:** ![Frozenfire](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Frozenfire](https://forums.unrealengine.com/u/Frozenfire)\
**Post date:** [January 12, 2016, 10:38am UTC](https://forums.unrealengine.com/t/tracehitinfo-returns-default-physical-material-instead-of-current/343712/4 "2016-01-12T10:38:22Z")

</div>

oh … so setting the material again would work ? if that’s the case i would try that.

as a suggestion , I would suggest that perhaps the system could update the component when the physical material is being set. Or if that wouldn’t work, maybe it could set the material again when the physical material is being ‘set’.

---

<div class="post-metadata">

**Author:** ![Dig\_Squid](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dig_squid/32/1145423_2.png) [@Dig\_Squid](https://forums.unrealengine.com/u/Dig_Squid)\
**Post date:** [January 12, 2016, 10:44am UTC](https://forums.unrealengine.com/t/tracehitinfo-returns-default-physical-material-instead-of-current/343712/5 "2016-01-12T10:44:48Z")

</div>

Yes setting the material again should work. The problem is the engine doesn’t track all the components using a particular material, so it doesn’t currently know which components to update when a material changes. We’ll give this some more thought…

---

<div class="post-metadata">

**Author:** ![Manoloon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/manoloon/32/1001796_2.png) [@Manoloon](https://forums.unrealengine.com/u/Manoloon)\
**Post date:** [March 1, 2017, 12:54pm UTC](https://forums.unrealengine.com/t/tracehitinfo-returns-default-physical-material-instead-of-current/343712/6 "2017-03-01T12:54:48Z")

</div>

any solution to this?! I am working with version 4.14 and this problem persist

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [March 3, 2017, 5:03pm UTC](https://forums.unrealengine.com/t/tracehitinfo-returns-default-physical-material-instead-of-current/343712/7 "2017-03-03T17:03:56Z")

</div>

Here’s a link to the issue: [Unreal Engine Issues and Bug Tracker (UE-25200)](https://issues.unrealengine.com/issue/UE-25200)

It has been marked as by design. You can read the explanation in the Developer Notes section of the above link.

---

<div class="post-metadata">

**Author:** ![\_h2o](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@\_h2o](https://forums.unrealengine.com/u/_h2o)\
**Post date:** [December 9, 2020, 3:32pm UTC](https://forums.unrealengine.com/t/tracehitinfo-returns-default-physical-material-instead-of-current/343712/8 "2020-12-09T15:32:06Z")

</div>

still see this issue on static meshes in 4.23 (also 4.25) (skeletal and BSP returns right material).  
in 4.23 (also 4.25) i have found that if you ONLY assign physmat in material settings - only then it works  
if you assign in staticmesh or staticmesh component, in BP or level instance - you always see default phys mat.  
but the most strange thing that is another project based on 4.23 (also 4.25) where everythings works fine.  
so, can it be any config setting? editor setting? engine setting? (or something simillar)
