1
NGUI 3 Support / HP Bar for monsters disappears at 10%
« on: July 13, 2014, 12:45:10 PM »
I have a Monster prefab with a section for name, hp bar, and level. To get the health bar to show proper size I had to change the scale of the parent with the UISlider on it to .1/.1/1.0 scale so that I could leave the background and foreground sprites at their normal 50x8 size.
The problem with this is about 10% health the bar simply disappears I would assume because of the weird scaling. I have a completely separate UI in the game that shows your party and normal scaling and all those health bars work as they should.. it's only these "world" objects I spawn in game which I have nested some UI into.
The parent for all the UI elements has a UIPanel on it... is something being done incorrectly here to cause the need to scale things very oddly? I had to set the name and level for the monster to scale 1 also where normally it would be about 10.
Edit: I'm assuming the scale issue is due to not having the widgets under any kind of UIRoot? Not sure how to address it if so.. everything works fine in game if you simply toss widgets under normal GameObjects.. it just requires odd scaling.
Thanks.
The problem with this is about 10% health the bar simply disappears I would assume because of the weird scaling. I have a completely separate UI in the game that shows your party and normal scaling and all those health bars work as they should.. it's only these "world" objects I spawn in game which I have nested some UI into.
The parent for all the UI elements has a UIPanel on it... is something being done incorrectly here to cause the need to scale things very oddly? I had to set the name and level for the monster to scale 1 also where normally it would be about 10.
Edit: I'm assuming the scale issue is due to not having the widgets under any kind of UIRoot? Not sure how to address it if so.. everything works fine in game if you simply toss widgets under normal GameObjects.. it just requires odd scaling.
Thanks.