LineTrace enables CustomDepth if hits StaticMesh

Hello, I want to enable the CustomDepth of a mesh if I’m watching it, I have this setup right now but it doesn’t seem to work. The LineTrace (powered by an Event Tick) itself works, I can’t get the CustomDepth to toggle and I think it’s cause I’m using the equal node wrong. What should I change?

Thank you.

I probably found a solution myself, I’ll post it when I’m sure it works properly.

Alderbit explains this here Show Object Interaction - Community & Industry Discussion - Epic Developer Community Forums