Hey how would I go about making a floating enemy health bar?

I only want it to work if you are aiming at the player.
(This is for an online game).

Which the Networking part isn’t the part I need help with.

Just would like to know how to make it look like in the image (Just appear under the player) if you aim at him.

Such as the one in the image.

(I’m not familiar with this new UI) so I’m kind of lost.
Right now I have a World Space Canvas just on my enemy, if an object runs into it, it gets covered up and is always on.

In simple terms:

  1. Raycast from the Camera forward, and store the transform.position of the enemy object if the ray hits one. If you need to access any variables on the enemy object, store these as well (or store the whole object)
  2. Convert the enemy object’s position into screen space coordinates.
  3. Use these coordinates to draw the health bar on screen. For the specific health value, access the necessary variables from 1).