Get surface type on mouse click not working?

Hello everyone,

lately i’ve been fooling around with some blueprints and tried to make a point a click.
So whenever i click i save that location and send the player to it. But then i noticed i can click on walls and some other unwalkable parts and the player tries to go there stopping at the wall. Well not much of a problem with that.

But then decided to show a marker where you click just to show you exactly where the character will go, the problem is that the marker appears on walls too and that’s pretty ugly.

So i wanted to get the surface type and check if it’s of floor type and only then spawn the marker and move the character.

The problem is that it doesn’t matter where i click with the mouse, it always return the same surface type…

I’m using “Get Hit Result under Cursor by Channel” node to get the hit result. Then from the hit result pin i connect it to “Get Surface Type” node, then a “Switch” from this node that gives me 3 output pins: “Default”, “Floor”, “Walls” (those 2 i created them in project settings). For testing purposes made some prints nodes to check the return value:

Always “Default”.

I made the phys material for the floor and set it up on the floor material too (even tested with the hit of another actor and for that actor it’s working properly but not for the mouse).

What am i doing wrong?

Thank you very much for your time!

Someone?
I kept testing with no success… Is this a bug that should be reported? or is there some error on my end i missed?

You need to post your blueprints. This idea works fine but how can anyone help you if they can’t see what you did?

Oh yeah my mistake, i thought that was enough with the explanation. Here it is the bp shot:

&stc=1

It doesn’t matter where i click, everytime it prints “Default”.

Why not just adjust your trace channels so that you are only tracing against the floor?

As for surface type, the first guess would be to double check you are in fact tagging the surfaces properly to begin with.

Thanks for your reply,

i need to know when i’m tracing against walls and some other sm too, so adjusting the trace channels only for the floor wouldn’t work for me i’m afraid.
And yeah i made sure it was set up correctly. I thrown a cube in there and on its hit event did the check for surface type and it printed correctly when it was hitting in the “floor” or in the “wall”… so i don’t know :confused:
The setup is pretty simple isn’t it? You set up the physical surface in the project settings/physics, then you create a physical material in the content browser, in its properties you set the desired physical surface. Then in the material you set that created physical material. And then just set this material to the desired object.

Could someone please test this on and tell me the result? just to know if this is a bug to report or just a problem on my end…
Thanks.

Check this tread too Event hit (hit phys mat) always return (default) in surface type - Programming & Scripting - Unreal Engine Forums