What does TimeUtility.FramerateDeltaTime works for?

contac

Member
emm...why use this rather than Time.deltaTime?
And this code make me confused:
var deltaTime = m_CharacterLocomotion.TimeScaleSquared * Time.timeScale * TimeUtility.FramerateDeltaTime;

it means, deltaTime = m_TimeScale*m_TimeScale * UnityEngine.Time.timeScale * 60FPS * Time.deltaTime,

I think it's a little hard to calculate speed...

I would appreciate it if you could tell me something about it.
 
Time.deltaTime returns the time passed (in seconds) since the last frame update.
TimeUtility.FramerateDeltaTime returns Time.deltaTime * c_TargetFramerate, where c_TargetFramerate is 60. This means that FramerateDeltaTime increases as the user's frame rate (as a factor of 60) decreases. So if the user has a framerate of 60, it'll return 1, whilst a framerate of 30 will return 2 and so on.
 
I think i can understand you, is't that: if i use TimeUtility.FramerateDeltaTime, I can get a value nearby 1, and without it Time.deltaTime has the same ability to do the same things?

Thank you for your reply, hope that the CharacterController can make it more convenient and accurate to control the speed~

Thank you again, have a nice day!
 
Yes, both Time.deltaTime and TimeUtility.FramerateDeltaTime increase as the user's frame rate decreases. The difference is that Time.deltaTime is in seconds since last frame, whereas TimeUtility.FramerateDeltaTime is a factor of the target framerate (60).
 
Sorry to dig up an old thread, but I still don't follow why we use FramerateDeltaTime instead of Time.deltaTime in CharacterLocomotion? For example, I am working on a VR game where the target framerate is 90, and it seems like TimeUtility.TargetFrameRate is fixed. It just feels like I'm multiplying my intended velocity by 60 right now (I'm using ExternalForce to move the character since my character needs to move in x, y, and z).
 
Top