Hi, I'm using HUDText in my iOS game. Each HUDText follow a character to display damages.
In the worst situation, there'll be 14 characters keep popping up numbers via HUDText(not too heavy, right?).
![](http://www.tasharen.com/forum/index.php?action=dlattach;topic=7963.0;attach=3616)
![](http://www.tasharen.com/forum/index.php?action=dlattach;topic=7963.0;attach=3618)
At first I didn't give it much attention in Editor. 0.6ms is quite affordable.
![](http://www.tasharen.com/forum/index.php?action=dlattach;topic=7963.0;attach=3614)
Things change when I run it on iPad2. As you can see, HUDText took around 8ms for each frame, sometimes it can up to 16ms.
![](http://www.tasharen.com/forum/index.php?action=dlattach;topic=7963.0;attach=3620)
So I'm wondering what costs alot on mobile device, and how to fix it.
Now a few potential reasons appear but I have no idea which have higher priority.
First comes to my mind is transparent, where HUDText uses to fade out numbers, because Game.Renderer for transparent is also heavy for my scene.
Then I find UIFollowTarget.Update() have Camera.WorldToViewportPoint in it, will it costs alot if I have so many characters?
Any suggestion to optimize my game? Thank you!
NGUI: 3.4.8
HUDText: 1.1
Editor: Mac mini (16G mem & SSD)
Device: iPad2
* I changed UIFollowTarget a bit so particles can follow UI, mainly is a SetTarget function and an offset.
void Update ()
{
Vector3 pos = gameCamera.WorldToViewportPoint(target.position+mOffset);