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. Dismiss Notice

Question Hide and show object

Discussion in 'Scripting' started by unity_TR7C4xry9zxIAw, Dec 10, 2020.

  1. unity_TR7C4xry9zxIAw

    unity_TR7C4xry9zxIAw

    Joined:
    Jul 8, 2020
    Posts:
    26
    Hello, I wonder how to hide and show at specific time.

    Please help me..
     
  2. Terraya

    Terraya

    Joined:
    Mar 8, 2018
    Posts:
    646
    This code will turn your object off and back on
    Code (CSharp):
    1. object.setActive(!object.ActiveSelf);
    if you want todo it at a specific time, you need to describe it a bit better
     
  3. unity_TR7C4xry9zxIAw

    unity_TR7C4xry9zxIAw

    Joined:
    Jul 8, 2020
    Posts:
    26
    Thank you for your reply, I would like to automatically have the object shown and hidden for a certain time.
     
    Last edited: Dec 10, 2020
  4. Terraya

    Terraya

    Joined:
    Mar 8, 2018
    Posts:
    646
    Then you can add a Timer in your update Loop or make a Coroutine :)