Search Unity

Question I want my function to wait for seconds after getting triggered in Update method.

Discussion in 'Editor & General Support' started by hitesh007yt, Oct 18, 2021.

  1. hitesh007yt

    hitesh007yt

    Joined:
    Nov 24, 2019
    Posts:
    3
    I have a game that has a "GameOver" Boolean that becomes "True" when the player dies or completes the mission.
    after that GameOver Ui becomes true and it will show. how many Coins player has earned and how much score he got. this calculation happens in a really simple way in the Update method.

    Help I need:
    currently, Score and Coins Ui Text has no animation.
    I'm using Lerp ( 0 to Score value) and (0 to Coins Value) to make a cool effect so it looks like Score is growing 0 to actual Score value. Hope u understand.
    and I manage to do so.
    But as soon as Game overs and Ui elements become Ture. my Lerping function starts and ends shortly after.
    It's like a 0.2sec effect and that sucks.

    This is what I want.
    when Ui elements become true after 1sec delay. The score will start Leaping and then when it finishes next One which is the Coins value will start Lerping. so player can see the effect. i

    I have seen this type of effect in almost every game and there is no tutorial on Youtube.

    Unity Gods plzzzzzzzzzzzzzzz Helpppppppppppppppppppppppppppppppppp.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,739
  3. hitesh007yt

    hitesh007yt

    Joined:
    Nov 24, 2019
    Posts:
    3