Author Topic: NGUI Health Bar directly above on Minion - Camera Angle Problem  (Read 5073 times)

fbaez51

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 5
    • View Profile
NGUI Health Bar directly above on Minion - Camera Angle Problem
« on: November 12, 2014, 09:19:06 PM »
Hello NGUI Forums,

My first post!

My current problem is the "Life Bar" which is a simple progress bar is NOT staying directly on top of the moving minion. The minion is suppose to move from the left side of the screen to the right. I currently have the progress bar following an empty game object above the moving minion on transform (0,3,0).

I am hoping the forums can explain why the progress bar appears left on the minion on the left side of screen, middle in the center of the screen and right on the right side of the screen. I am sure it has to do with the angle from the camera to the progress bar but just cant figure how to fix it. I would like it to stay above the head at all times.

Please let me know any tips or ideas I may try! I will greatly appreciate it!

I have attached 3 pictures from each view point to this post to help demonstrate the situation.

Thanks!
Felix

fbaez51

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: NGUI Health Bar directly above on Minion - Camera Angle Problem
« Reply #1 on: November 13, 2014, 08:01:30 PM »
Update:

The life bar looks great in Orthographic but the rest of the map/game is not the perspective I would like to keep it as. Is there a way to make the NGUI orthographic and make it work with the perspective view of the game.

Best,
Felix

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI Health Bar directly above on Minion - Camera Angle Problem
« Reply #2 on: November 14, 2014, 04:52:56 AM »
UI should be 2D. It may follow a 3D object, but the UI isn't 3D itself. Keep the UI camera as orthographic.

fbaez51

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: NGUI Health Bar directly above on Minion - Camera Angle Problem
« Reply #3 on: November 14, 2014, 07:25:57 AM »
Hmm ok, I am sure the camera is set up as you mentioned but I will try and check it tonight when I get home and make sure. I will update this post of my findings.

Thanks for the reply ArenMook.

- Felix

fbaez51

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: NGUI Health Bar directly above on Minion - Camera Angle Problem
« Reply #4 on: November 20, 2014, 11:19:02 AM »
My apologies, I have been using HUD Text Add on for the life bars.

Not sure if that affects your reply.

I did not figure out how to completely fix the problem but I temporary will have the Life bars closer to the minion. It gives less of a angle view on the bar.

Let me know if I can try anything else to fix the problem.

Thanks for your help and keep up the good work. :)

Best,
Felix

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI Health Bar directly above on Minion - Camera Angle Problem
« Reply #5 on: November 20, 2014, 08:51:25 PM »
As I mentioned, use a 2D UI not a 3D UI. HUDText or no HUDText, it's the same requirement. Your UI must be 2D.

If you insist on making it 3D, then don't even bother with the UI. Make your healthbars a part of your 3D model, on the same layer, drawn by your game camera. All you need is a UIPanel on a game object, and you can add widgets below it.

fbaez51

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: NGUI Health Bar directly above on Minion - Camera Angle Problem
« Reply #6 on: November 21, 2014, 08:09:16 AM »
Hmm Ok, I am sure I am just missing a step. I will check it again once I get the chance and respond with a update.

Thanks again for replying, your awesome.

- Felix