Line trace to hit only objects from certain classes?

I have a widget based menu system, and I need to use the disable depth test option to get the menu to be visible in smaller areas of my map, else menus gets spawned behind the floor, walls etc. The visible part works with disable depth test, but I can’t figure out how to get the line trace to follow the same procedure. When the menu is on, the line trace should hit only that active widget or object. Any ideas?

Create a custom ***Trace ***channeland ensure that the widget is using it. Also ensure that nothing else is using it. Use this channel when tracing, this will ignore anything else in the way.

THANK YOU! Seems like this solved my problem. If anyone else is wondering, I had to create a new trace channel in Project Settings -> Collisions. Then, in the WidgetInteraction component that I am using, I had to change trace channel to the new one. Last, I had to change the collision settings on objects that was interfering/blocking my trace to ignore the new trace channel. :slight_smile:

Well done. This is a great resource if you are ever in doubt:

@Everynone I got a problem with trace channels, when I put it to block all, it also detects the air, how can I fix it?

What do you mean it detects air? You must elaborate! What is air in this context?

When you trace hit something, you can print its name; what do you hit when you trace?

There’s probably no such thing as air in this software, I found that it was actually hitting the ambient sound that I placed, but I couldn’t find option to select collision responses on it

They have no collision. How did you find out? What component display name do you get when trace hits?

AmbientSound.Sphere I found it with print string, I found out I had to open it in order to disable it, probably a silly begginer’s mistake.
Also in the subject of collision, something very weird is happening, when I enter water (water plugin) the capsule descend according to the land, but the mesh is up the river at shallow water then suddenly goes down. At the lake the mesh is always on top while the capsule at the bottom. I made an “water” object at the collision (default=overlap). but then I made sure everything I’ve set up (regarding swimming and also capsule) in the blueprint was disabled, but it is still happening. I changed to overlap visibility channel, it fixed a bit, but not completely. Do you know what might be? I might create a topic on it so I don’t fill up other’s topic.