some execution order questions

Hi there!

Can someone tell me how the execution order works in these cases:

  1. 2 game objects with the Start function. Which one runs first?
  2. Does a parent game object’s start function execute before the start functions in the children?

Thanks!

edit: While im asking, I forgot a detail abou C#. If I have have a function a() and b()

{
a();
b();
}

Does b start before a is finished executing. If I recall correctly, it doesn’t. B waits untill A is finished. Or am I remembering incorrectly?

About your second question, you are right, the functions are called in sequence. If you want to run multiple functions at once (asynchronously), there are C# methods to accomplish this (BeginInvoke and EndInvoke). You could also accomplish it with threads.

  1. Random basically, there is no order which you can rely upon unless you establish it yourself
  2. No, definitely not.

StartCoroutine can be used for asyncronous code too

Thanks!