Hi people, i already post this on Unity3D forum but no answers yet, So… and im stuck trying to add a health bar to the enemies, the way Brackeys do it on the video comsumes a lot of processing power and fps drops a loot because when an enemy spawn, and you have a lo~ot of enemies (more than 10) the performance of the game get worst and worst mostly because there’s a lot of canvas in the scene.
So… im trying the next:
I create an EnemyHPBar and make it a prefab, and make an instance of it and then make it children of an specific canvas called enemiesHealthBarCanvas and put the render mode WorldSpace.
On the enemy prefab i add a script called healthBarScript with the next code:
On the inspector the enemy looks like this:
aslo the script of the enemy is the next one:
and the script for enemyMovement is the next one:
if someone could give some light to my problem i’ll be glad, if you need some more info let me know, in advance thanks for the help, and sorry for my bad english.