Order of events in scripts

Is there a definitive order I can print and have on the wall (next to the obligatory degrees/radians and easing formulas)?

I found a post with some of it:

  1. script update
  2. script on_message (get message sent to self on update)
  3. physics update (get physics messages in on_message)
  4. render script can get message from active camera component
  5. render script update

If there is an on_input event, where does it fit into the list above?

1 Like

The engine update loop and order of processing can be seen here: https://defold.com/manuals/application-lifecycle/#the-update-loop

1 Like

I found that image, but not sure which comes first… is this right?

  1. on_input
  2. script update
  3. script on_message (get message sent to self on update)
  4. physics update (get physics messages in on_message)
  5. render script can get message from active camera component
  6. render script update

Yes, that looks about right. Keep in mind that we do not guarantee an order in which the different component types get updated, but currently I believe script components get updated before physics components.