order of gameobejcts


I am new to unity.

q1) The order of what script gets executed first is determined through script execution.
If I have a number of enemies with the same script then what script goes first as a matter of interest?


If they all use the same script, they execute in some order which is not necessarily random but is arbitrary. It might be the same order that their GameObjects got created in, but you shouldn’t rely on this (because it could be different depending on the platform or how you attached the scripts or what the situation is). So either you should write code in such a way that the order doesn’t matter, or you should control the order with (for example) a single EnemyManager object that calls a function of each enemy in whatever specific order you want.

The order is undefined unless you use the script execution order settings. The docs you linked to explain everything.