Download

Blueprint Function Suggestion: Get Physics Material and Get Surface Type

Hello Epic!

Recently I tried to get the Surface type out of an Actor’s material but I found no way of doing this.

Why? Because the In-parameter of “Get Surface Type” is a Collision Hit.

It would be fantastic if you could implement a function which can be used in this fashion:

Actor -> Get Material -> Get Physics Material -> Get Surface type.

Kind regards, Sjonsson

Are you doing this in C++ or Blueprints?

You can’t get a material directly from an Actor, because the Actor could contain multiple Components, each with multiple materials. You can ask a specific component for the material on a specific section though.

How do we do that in blueprint?

When you perform an overlap you can Cast to whichever actor is being overlapped, and then get the variable of the component you want out of that actor, then get the material of that component.

For trace hit you can get the component and physical material together with the actor in Break Hit Result directly so it’s even easier.