Time.deltaTime doesn't work with condition or on unactive GameObject at the begging,Using Time.deltaTime with condition or GameObject not active at the beggining
I'm working on simple 3d mobile game. At the end of gameplay I would like to create Panel with simple increasing/decreasing score values.
The problem I have is that when I run this script in most basic way it works:
void Update()
{
t = Mathf.MoveTowards(t, 1.0f, Time.deltaTime/scoreAnimationLength); // Move t towards the second value
int scoreToDisplay = (int)Mathf.Lerp(0, 111222f, t);
scoreText.text = "Score " + scoreToDisplay.ToString();
}
but if I add condition to it:
if(GameManager.instance.gameOver == true) {
...
}
or as it suppose to work - make Panel UI GameObject unactive at the beggining and make it active on gameOver - this script doesn't work. I mean it changes the values, but with out animation - displays just final valuses.
How I can make it work?
Comment
Your answer
Follow this Question
Related Questions
How to use time, when timeScale is 0? 2 Answers
Type out text in sync with audioclip 0 Answers
Game Clock (Like in "The Escapist") 1 Answer
how to display stopwatch ss\fff as string? 2 Answers
Mining in RTS 0 Answers