Isn’t it more efficient to destroy the gameObject with health bar altogether then go to every frame calculating Approximately function and hiding the bar? I guess if your game logic has revival of characters then it could be a problem.
While we don’t have that mechanic in place for this course, it’s touched on in the final course, Shops and Abilities. This just leaves things open for revival.
In my own game, the SaveableEntity is actually a spawner that spawns the character with all of the components, and keeps track of the current status, either Dead, awaiting respawn, or the stats of the existing character. In our course project, it’s the character that is the SaveableEntity, and if it’s respawned, we’ll need that health bar.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.