Exporting Framerate

From ETC Public Wiki
Revision as of 12:42, 28 February 2012 by Christel (talk) (fixed link)
Jump to: navigation, search


The Update function runs every frame, and not all the computers have the same frame rate. To make your game run at the same speed regardless of frame rate, adjust the speed of dynamic actions using Time.DeltaTime (ie, multiply them by Time.DeltaTime).


Delta time is the time it took (in seconds) for Unity to complete the last frame. More explanation

void Update() {
       float translation = Time.deltaTime * 10;
       transform.Translate(0, 0, translation);