#Hide hp bar if it intersects with other ui

1 messages · Page 1 of 1 (latest)

worn goblet
#

[so for example, if I have say, an equipment interface up, and the hp bar would be positioned on the screen somewhere that would block some of the interface, it would hide the hp bar so it's not in the way]

The way the hpbar gets positioned is with mainCamera.WorldToScreenPoint on the Enemy's position in 3d space. if I was positioning the hpbar to the mouseposition this would be trivial, as I could just use EventsSystems to determine if the mouse is over ui elements, and check what the elements are.

#

but the position is instead set based on where the enemy is in 3d space

#

I figure there's some sort of raycasting that I could do to check, similar to the eventssytem thing, but I'm not sure what I'd need to do.