I have a requirement where I do a simple line trace when I’m shooting using a gun and upon getting a hit result, according to the physical material I’m getting I’m spawning a particle effect.
Here is how I have set it up.
I have created a physical material and set the surface type to a custom surface type I made.
And that physical material has been set here
Here is how I’m trying to get the physical material
][5]
Issue
When I try to get the physical material using the above mentioned line trace configuration.
bool isHit = GetWorld()->LineTraceSingleByChannel(Hit, EyeLocation, TraceEnd, COLLISION_WEAPON, QueryParams);
I always get DefaultPhysicalMaterial. But If I try to get the physical material using ECC_Visibility Channel. I get the correct physical material associated with the mesh.
I am unable to figure out the issue here. Any help would be much appreciated.
I am using unreal 4.26.1