0
\$\begingroup\$

I'm trying to make a simple console application and don't want to use Unity, but I want to implement a timer, so I would want to use Time.deltaTime.

\$\endgroup\$
2
  • \$\begingroup\$ Time.deltaTime is a Unity specific thing. If you want one in console application you can use a 3rd party lib or write your own. Time.deltaTime is calculated as time between frames, so if there are no frames and Unity engine is not running - the value probably won't be calculated. That is my assumption. Even if the value would be calculated it would be completely irrelevant value to console application. \$\endgroup\$ Jul 2, 2022 at 11:09
  • \$\begingroup\$ Are you asking how to program a game-loop and measure the time elapsed per frame? What have you tried, based on your research of existing guides and Q&A so far? \$\endgroup\$
    – DMGregory
    Jul 2, 2022 at 11:38

1 Answer 1

0
\$\begingroup\$

It is done by calling a timer every frame per second that holds the time between now and last call in milliseconds. Thereafter the resulting number (delta time) is used to calculate how far, for instance, a video game character would have travelled during that time.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ This answer would be better if it included code showing how to do that. \$\endgroup\$
    – DMGregory
    Jul 2, 2022 at 12:36

Not the answer you're looking for? Browse other questions tagged .