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

How instantiate object in the specific time?

Discussion in '2D' started by faisalrahman, Sep 20, 2020.

  1. faisalrahman

    faisalrahman

    Joined:
    Feb 3, 2019
    Posts:
    9
    Hi, does anyone here know how to instantiate a gameobject at a certain time?
    for the example I have 2 object (Object A and Object B), I want to instantiate Object A at the 5 second, and I want to instantiate Object B at the 10 second in the position of Object A and destroy or disable Object A.
     
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    @faisalrahman

    This isn't a 2D question... but I bet many people here know how to do this; you are listing several tasks that are pretty easy on their own. Instead of asking, maybe you should google the steps and then figure those out yourself?

    - Wait for a specified time
    - Destroy/SetActive object
    - Instantiate or SetActive a new object

    Timer can be created using a variable that you add to in Update until it is full or use a Coroutine or InvokeRepeating for similar thing.
     
  3. faisalrahman

    faisalrahman

    Joined:
    Feb 3, 2019
    Posts:
    9
    I'm sorry, I'm new in unity forum, but thank you for the advice.