Update() Function in Unity
Notes:
Update() Function in Unity:
6. Continuously frame gets updated and rendered
Update method:
- is called once per frame continuously, depends up on game's frame refresh rate.
- Frame refresh rate is measured in FPS (i.e. Frames Per Second)
- if game is running at 30FPS then Update method is called 30 times per second
- if game is running at 60FPS then Update method is called 60 times per second
- is best for any non physics based updates, receiving user inputs etc.
Example code:
void Update()
{
Debug.Log ("Update");
}
Note: FixedUpdate method is independent of game's frame refresh rate.