2
\$\begingroup\$

I have game object which displays health indicator in my 2d video game in Unity. This gameobject contains a lot of sprites and i put it into left/top corner of the screen. In my game editor it is visible entirely but on my mobile device is visible only half of it. How can i make it visible entirely on all screens? Can anyone help me to solve this problem please.

P.S. I have some ideas how to do this: 1. Create health indicator from GUITexture elements. But it is not good for me, because health indicator consists of a lot of small elements and it will take a lot of time for me to resize every GUITexture according to my needs.

  1. Put my gameobject with health indicator into another gameobject with zero transform, and then put parent GO into top/left screen using Camera.main.WorldToViewport method.

But may be there is more easy way to do this?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

From Unity 4.6 on the GUI system easily allows you to place any texture or sprite in screen space. It allows you to build complex HUDs including helath bar. See this video for an introduction

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for the answer and for the video. I'll check the new features of Unity 4.6. For this moment i am using Unity 4.5, may be you also can give me some advices how to do this in it. But upgrading to 4.6 is also very cool idea if it doesn't take a lot of time for creating HUDs in it. \$\endgroup\$
    – bukka.wh
    Commented Dec 9, 2014 at 9:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .