K
K
Kirill Kichigin2017-03-28 20:10:47
Unity
Kirill Kichigin, 2017-03-28 20:10:47

How to make a number decrease every second in C # under unity?

I am making a character satiety script and I need the number to decrease by one after some time and at the end, when the number is exactly 0, some actions are performed. Who cares about the time please tell me how to do it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2017-03-28
@KiR_Ka

1) Read a book on C #, something for beginners
2) Understand what Update, TIme.deltaTime is in any way possible, for example, using unity tutorials
3) Paint the algorithm for what you need with an eye to paragraph 2
4) Implement the algorithm.
The question is not only primitive, it is also a task. If you can’t implement this, then it’s too early for you in game development

A
Alexander Shindin, 2019-12-08
@Defren

Yes, what's incomprehensible here, you divide Time.deltaTime by Time.deltaTime you get time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question