How to get physical material override?

Hi,

I have a Blueprint with a static mesh component of which I set the Phys Material Override to a custom physical material.
However when I try to print the values (friction, restitution etc.) via MyStaticMeshComponent->GetMaterial(0)->GetPhysicalMaterial() it returns only default values.
How can I get the instance to my custom physical material? GetNumMaterials returns 1.

GetMaterial(0) actually returns the physical material, but not as a physical material instance. Is there a way to cast it to a PhysicalMaterial?

1 Like

Well, it’s quite an old question, but it comes first in the google while i was looking for answer.

So far, it seems that for 5.3 the answer is:

UStaticMeshComponent* or UStaticMesh* β†’ GetBodySetup() β†’ GetPhysMaterial()

In BP, it should / could be:

But since Chaos took over PhysX, things are somewhat all over place.

3 Likes