Is it possible to hide ui widget behind actor?

Hi

You could use a line trace, and only if character is seen then widget shows,

I’ve made simple health bar placed above my third person character. The problem is the health bar renders when it should not - i.e. when character is hidden behind , health bar is still there.
Is there some sort of Z-index for static meshes to be used with widgets or is there some proper way to make it work?

Thank you.

Thanks for the idea, i’ll try it.

Well, it works but still it’s not a complete solution. I mean partial visibility, when only part of is hidden

You prob figured this out some ago but figured Id suggest something. You could do a Static Mesh Component in your character class or for whatever it belongs to, that way it is a 3d that will be occluded by walls and such already as is. From there you could set a Material Instance to Static Mesh Component and use code on your Character to modify the Material Instance to show changes and updates.