When i killed the Orb, the game restarts. But i won’t let the game restart after killing the Orb.
And i want to remove the Healthbar of the Orb on the screen. What should i do to fix that.
You can see the example how i want it in the first minute of this video: Pantera 3d Third Person Shooter Gameplay
…you’ll find that the game no longer restarts. If you killed the Orb, you’ll need to Instantiate() another one!
If you want the player to respawn:
Change the code above to this, and notice the new position of the /* */.
if (hc.tag == "Player")
StartCoroutine(PrepareRestart(false));
/*else {
StartCoroutine(PrepareRestart(true));
}*/
Now the Orb will die without causing restart, and the player will respawn
If you want two Orbs, and you’ve duplicated the Orb in the scene, go to the Death Manager script on Controller, drag Orb2 on to the word “Entities”, and this will add a 3rd element to the array of objects being controlled by Death Manager. Now it will die.
A good exercise would be to make a copy of the Progress Bar script, add this to “Controller” so it has 3 Progress Bars, and modify it so it is below the other one and monitors Orb2.