Jump to content

How to get time since last update?


Guest

Recommended Posts

Posted

I am writing a script that uses RegisterForSingleUpdateGameTime to update a value every hour. This will only update once at the end of waiting/sleeping for a certain number of hours.

 

What is the pattern I should use so that I can determine the "time since last update" and so increment the value by the correct amount when the event fires?

Posted

I am writing a script that uses RegisterForSingleUpdateGameTime to update a value every hour. This will only update once at the end of waiting/sleeping for a certain number of hours.

 

What is the pattern I should use so that I can determine the "time since last update" and so increment the value by the correct amount when the event fires?

One possible way would be to store the time whenever you update, and then next time you check that against the new time when it fires again.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...