FixedUpdate() Function in Unity

Notes:

FixedUpdate() Function in Unity:

6. Continuously frame gets updated and rendered

I.e. After first frame of the scene is created update and render cycle is executed.

Awake and Start event methods are considered as initialization event methods. They are used to determine object’s initial state in the first frame; whereas Update event methods are used to determine the object's Nextstate in the subsequent frames continuously.

FixedUpdate method:
- is called after every predefined fixed time interval
- Edit - Project Settings - Time - Fixed Time Step - 0.02s

- is best for physics based updates

Ex:
- move game object by applying some force
- rotate game object by applying some torque
etc.

Note: Update methods are executed only if script is enabled.

Example code:

void FixedUpdate()
{
Debug.Log ("FixedUpdate");
}