![]() ![]() No I am not the right person to pinpoint the exact reason, we need an inside man from Unity for that )Ĭalculate the position and simply place a health bar image on each character ? So it is very much clear there is something wrong on how we are handling canvas in this case. (These may come as spikes and not on all frame updates) This is development built(Android) and also has some role to play in reducing fps.Ĭanvas.SendWillRenderCanvases() takes up 14 ms, (My mobile model is Moto X Style/Pure just for your configuration reference) Public class PlayerGenerator : MonoBehaviour FPS", fps) Here I have one PlayerGenerate.cs Script, that generates players using UnityEngine (spheres in my case)Ĭreate character prefab with a world canvas as its child (arrange the canvas as you like, this canvas will also have a health bar image) Let us understand this case with an example and then finally discuss the ideal solution. But well is that easy part really worth compromising on 10-15 fps of your game? NO? I must say that you are right on the easy part. ![]() I am sure more than half of you would come up a same common idea “It's easy, add world space canvas for each character, simple as that!”. How will you place health bars in a 3D world? Now let us understand our case in Unity terms. Ideal example where health bars are used would be Age Of Empires (screen shown below). Just a few 50 such health bar images can drag down your game for good. In 3rd person games, these health bars (on characters) if not dealt properly can cost you minimum of 15-20 fps !! How can that put you in any kind of trouble? You might think it’s just a filled image. Health Bars? Is it really that big of a deal?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |