Hi frnds,
i am new in unity. i m working on a 3d runner game. i studied a code of 3d game…in that code many time used a keyword FixedUpdate. i also read about fixedupdate in unity.but i can’t understand it…(This function is called every fixed framerate frame, if the MonoBehaviour is enabled.) … plz anyone tell me how we used it … which functions are call in the Fixedupdate…plz Thanx frnds all of you…in advance…for giving me your important time
FixedUpdate as the name suggests called at fixed time interval unlike Update which gets called varying number of times in a particular time interval.
E.g. The Update function may get called 30 times a second on low end devices and 80 times a second on high end devices. But FixedUpdate will be called specific number of times in a second, say 50 (You can set interval in Edit → Project Settings → Time → Fixed Timestep).
As to you asked How I use FixedUpdate, it is recommended to use this while manipulating the physics. This way you don’t mess up the internal physics engine calculations (as opposed to Update) as FixedUpdate is created with this purpose in mind.
Also there are few questions related to what you asked already answered:
-
What is a Fixed Update?
-
What’s the difference between Update and FixedUpdate? When are they called?
Second question has an elaborate answer to get these concepts clarified.