- Home /
Question by
Barseno · Feb 23, 2011 at 12:46 AM ·
frameorder-of-execution
In what order do the Unity functions execute during each frame?
I'm wondering in which order each built in function executes during each frame.
For example:
Update() runs before LateUpdate()
The one I am concerned about the most is whether OnCollisionEnter() runs before Update() during each frame.
Does anyone know of an overall list of the priority on these functions?
Thanks!
Comment
Answer by tertle · Feb 23, 2011 at 01:03 AM
I do not believe it is really deterministic, though I could be wrong.
- Really you just know that LateUpdate() will run once per a frame after Update().
- Update() will run once a frame and
- FixedUpdate() may run multiple times per frame.
- OnCollisionEnter() Should only be called when a collision occurs, and would be based off FixedUpdate() time.
Your answer
Follow this Question
Related Questions
When, in the frame, do colliders generate? 1 Answer
switching gun on screen with gun you pick up. 3 Answers
help with code for changing an objects rotation? 2 Answers
How do I reset a variable? 2 Answers
About www.error! 1 Answer