Hi,
In my 2D game I need to make GUI elements to follow players around. Imagine in a top down space shooter you want to display health as a number on player and enemies and when they move, that GUI elements is stuck on them and moves with them.
How can I achieve this?
Thanks.
You can take a look at the space shooter tutorial, or project that Unity provides. The stuff related to the camera specifically can be found here.
Camera.WorldtoScreenPoint (), I believe it is.
I haven’t quite familiarized myself with it but I believe it allows you to achieve what you want to achieve.
I’m not sure if this would be the correct way to do this but i would recommend at least trying “Hinge Join 2D” found under components thats how i add objects to my main character not sure if it would work for you.