Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Disable progress bar

Discussion in 'Scripting' started by alideveloper95, Jan 11, 2020.

  1. alideveloper95

    alideveloper95

    Joined:
    Oct 5, 2017
    Posts:
    4
    I write game in which when a enemy kill by player. Then Enemy health bar disable. However it will not display on canvas unless enter another enemy territory.
     
  2. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,590
    Hello, and since it's your first thread: welcome.
    First of all, please dont post unnecessary polls.
    Secondly, what stops you from simply disabling the progress bar object once you dont need it anymore?
     
  3. alideveloper95

    alideveloper95

    Joined:
    Oct 5, 2017
    Posts:
    4
    I'm apologize but i was read documentation but no function provide, progress bar enable at the fighting time
     
  4. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,590
    You can disable any gameobject by using SetActive(false) on it. So if you have the reference to your progress bars, you can disable them and thus make them disappear.
     
  5. alideveloper95

    alideveloper95

    Joined:
    Oct 5, 2017
    Posts:
    4
    Thankyou