Book Image

Mastering Unity Scripting

By : Alan Thorn
Book Image

Mastering Unity Scripting

By: Alan Thorn

Overview of this book

Table of Contents (17 chapters)
Mastering Unity Scripting
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The world, time, and updates


A Unity scene represents a collection of finite GameObjects inside the same 3D space and that also share the same timeframe. Every game needs to establish a unified concept of time to achieve synchronized animation and change, because animation means change over time. In Unity, the Time class is available for reading and understanding time and its passing in script. Working with this class is therefore a critical skill for the creation of predictable and consistent motion in your games. More on this shortly.

Every game has a frame rate, which is defined in frames per second (FPS). This rate is viewable from the Stats panel in the Game tab. The FPS tells you how many times in 1 second Unity is able to loop or iterate through your game code to draw a new render from the cameras to the screen. Each iteration is called a frame. The frame rate varies dramatically over time and across different computers. It's influenced by the power of your computer, other processes...