Question by
WARdd · Aug 23, 2020 at 01:17 PM ·
fixedupdatetime.time
How to sync Update and FixedUpdate
I'm trying to write some code for doing a visual extrapolation in Update based on the last FixedUpdate. To do this, I need to know the time difference between the current Update and the last FixedUpdate.
I could do this by recording global times like:
private float lastFixedTime;
void FixedUpdate(){
lastFixedTime = Time.fixedTime;
...
}
void Update(){
float timeSinceFixed = Time.time - lastFixedTime;
...
}
But I'm kind of worried about time and fixedTime running up too high if the player leaves the game on for many hours while AFK or something. I would have too little precision after only 9 hours. I'm building an asset for the Asset Store, so I want this to be as reliable as possible.
Is there no reason to worry? Or can I do this some other way?
Comment