Physical Materials, not returning from Get Hit Result Under Cursor By Channel on Landscape

Hi,
I’m trying to “get” the Physical Material on a landscape layer using the Get Hit Result Under Cursor By Channel. I get nothing back. Not even “None”. In fact when I try to print it, my current debug prints move down the screen like something’s printing, but there’s no info there. I can print all of the other info from the Hit Result except for the PhysMat. I made a little video demoing my problem.

[YouTubeVideo][1]

At about 0:41 in the video you can see my current debug text go flying down the screen like something else is being printed, but nothing appears.

Hello CharlieTheTall,

I have a bit more information that I need from you in order to narrow down what is causing this.

1.) Can you recreate this in a new clean project?
2.) Does this happen in another version of the engine?
3.) Could you link me your DxDiag?

After I have this information I will attempt to recreate this issue on my end.

Thank you,

Hello Charlie The Tall,

I haven’t heard from you yet. I was wondering of you were still having this issue? Also have you had a chance to look into the previous asked questions?

Thank you,

Sorry, I got bogged down by other work stuff. I’ll get your requests together before the end of the week.

It’s fine. Whenever you post I’ll get a notification.

I did just recreate the issue in a new project using 4.9. Nothing gets returned from the Physmat. I’m attaching the Content folder from my repro case and my DX diag. I’ve only tried this in 4.9.1 and 4.9.2.

link text

Hey Charlie,

Thank you for reporting this to us. I have downloaded your project and tested it. What seems to be happening is there is a way to get the Physical Material but no way to return that value on screen.

I have entered a feature request. That ticket number is UE-21703.

I have no time frame for when our developers will handle this issue but I will keep you posted.

Thank you very much for reporting this to us.

I do believe it’s a bug and not a feature. If you try and compare it with either of the physmats assigned to the LayerInfos it just returns false. It’s like the info that’s coming back is not correct. If I try to get the Friction of what’s returned, it returns 0.0. Both layer infos have a friction of 0.7. Even when I give the landscape actor it’s own physical material, the friction of that returns 0.0.

If I declare a PhysMat variable and assign the PhysMat from the hit result to that variable, then try to access that variable, I get a warning that it returned none. I don’t think a Physical Material is actually getting returned.

Hmm,

Whenever I played your game I was able to see PhysMaterial = in the top left corner of the window. So it’s calling something. However, currently there is not way that I am aware to return the value. You can call it and assign it but not a true return value. Currently our development team is looking into this issue.

I’ll have more for you when I hear from them.

Hi Charlie,

The bug is that the GetHitResultUnder* functions do not request the collision system look up the physical material. I updated the ticket UE-21703 with this information.

Hello Charlie,

I checked the progress of this issue this morning. The problem is that the various APlayerController::GetHitResultAtScreenPosition() functions do not set bReturnPhysicalMaterial=true on the FCollisionQueryParams so it is never looked up.

This issue is marked as backlogged. I do not have a time frame for when this will addressed. Currently there are many issues which our developers have deemed a priority and they are handling all issues reported as fast as they can.

Ok, thanks for looking into it. Is it possible just to set that one thing “true” and recompile? Or is there more to the problem? I’m not a coder so if it’s more involved I’ll likely try to find a design solution.

Charlie,

That is one area where I couldn’t help you with. You could open another ticket with this issue in the coding section and see if it gets picked up. Someone there could give you some more insight.

Noticed this while looking up the same problem in 4.11. Since there is now a public issue tracker I figured I’d help by posting my workaround for designers.

Basically, since it’s only the under cursor checks that don’t return the material, doing a second regular line trace will return it for you. See the attached example.

Super awesome. Thanks!