How do I make Linetrace not go through the widget?

Hello! I have made each frame, with a delay of 0.01 pass the linetrace I need. I’ve made it so it doesn’t come on when the cursor is over the widget with is hovered, the player always has the option to use the cursor. It works almost completely correctly, with one exception: i.e. if the cursor is on top of the widget, linetrace is not created, but if clicked, the cursor sort of disappears and respectively the game thinks that is hovered should be false. To solve this, I have made it so that when LMB is clicked just no linetrace is created, but for a split second the same problem still occurs. I’m sure this is a pretty common problem, maybe there’s an easier way Or am I moving in the right direction?

If anything the Default Viewport Mouse Capture Mode is set to - “CapturePermanently”.

Thanks in advance for your reply, have a good day everyone!

Hi there @WolfDeaS081, hope you’re well!

This topic has been moved from International to Programming & Scripting: Blueprint.

When posting, please review the categories to ensure your topic is posted in the most relevant space.

Thanks and happy developing!