Here is my code:
var time : float;
function Start () {
time = 131065;
}
function Update () {
time = time+Time.deltaTime;
Debug.Log(time);
}
And “time” stops at 131072. Someone knows a solution for this?
Here is my code:
var time : float;
function Start () {
time = 131065;
}
function Update () {
time = time+Time.deltaTime;
Debug.Log(time);
}
And “time” stops at 131072. Someone knows a solution for this?
The only reason I can think that may be causing this would be because the TimeScale has been set to 0.
To see if this is the case, open the Editor, click on Play while having the Time Settings open (Edit → Project Settings → Time).
Check if the timescale changes to 0.
If that is the case, open monodevelop and do a Project wide search for the word: timescale, which will should reveal you the file that is setting it to 0.
I’m picking this is a floating point precision error.
In your example Time.deltaTime is small enough that adding it to a large value of time give you time.
veryLargeFloat + verySmallFloat == veryLargeFloat
Possible solutions