Question by
Noouhh · Mar 09, 2016 at 12:47 PM ·
guimultiplayerfpshealthbar
Having Trouble with Multiplayer Health Bar
So I've been trying to figure this out. My game is a multiplayer fps and I have the player's health bar in the top left corner of the screen. It works perfectly when playing alone, but once another player joins the bars overlap, making it very hard to read what is going on. The line of code I am using is:
void OnGUI(){ if (GetComponent().isMine) { GUI.Box (new Rect (10, 10, 100, 30), "HP | " + currentHealth); } }
Why doesn't this work and how can I fix this? Thanks!
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612071116im_/https://answers.unity.com/themes/thub/images/avi.jpg)