I have an enemy with a health bar. I need the enemy to rotate without causing the health bar to rotate around itself. I would prefer not to have another, separate movement script for the health bar, so what can I do? I also need to have the health bar parented to the enemy so that a script will work. How do I do TryGetComponentInParent? - Questions & Answers - Unity Discussions
Just make a “generic” LookAt script, make it look at the main camera and then but that on the Gameobject with the canvas on it.
The alternative is much more convoluted.
p.s. regarding “I also need to have the health bar parented to the enemy so that a script will work.”
That is probably not the case so if that needed to change or if it helped that would be very easy to change.
Pretty late, but maybe look into constraints, I haven’t used them myself but maybe it’s what you’re after