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

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.

For any and all delayed actions, I use my CallAfterDelay class for delayed action.

https://gist.github.com/kurtdekker/0da9a9721c15bd3af1d2ced0a367e24e

See usage notes at bottom below gist code.

TY so much

1 Like