Hello

I noticed that if gameobject is disabled (setActive(false)) , then time delta seems to freeze. Basically it returns the time since the last frame is displayed and when the gameobject has entered the disabled mode. Whether I enable the object 1 sec or 10 seconds later, it is the same value returned.

Any idea why or how to get around that?

My use case is I am basically I am using the time delta to move the object and it seems to resume from when it was disabled and not (say 10 steps later)

Thank you

I suppose the easiest way would be to create your own “deltaTime”:
At the end of a frame set

myDeltaTime =  Time.time - lastUpdate;
lastUpdate = Time.time;

and then use this “fake” deltaTime in the places where you need to use this tracked “time-since-last-update-even-if-the-object-was-disabled”. Would this work for you?

You can always use Time.realtimeSinceStartup instead - maybe at least when activating and deactivating an object? Or at least when reactivating an object, you could use it to find the time elapsed since disabling it with an appropriately set variable.