LineTraceSingleByObjectType does not return a physics material in its FHitResult

janimationd
Wed, 16 Mar 2016 19:08:25 +0000
World Creation

Hi,

I’m trying to get information about the hit object’s physics material out of a LineTraceSingleByObjectType() trace.

The object definitely has a physics material assigned to it, and I’ve assured that this object is being hit by the raytrace, but in the FHitResult the physics material reference is invalid. (myHitResult.PhysMaterial.IsValid() is false)

I am able to reproduce this in a brand new project. Also, this only fails when performing raytraces in C++. In blueprints they work fine and return the correct Physics materials.

How can I get the physics material out of the ray trace?

8 posts - 1 participant