Does the order that an items components appear make any difference at all to the object or it’s behaviour? Does putting, say, the FPS script ahead of the physics scripts make a difference? Or is the object instantiated as a whole entity with all things running (sort of)?
Component order does not matter.
I understand what you are saying but I think there should be more comments regarding the threat that was initially started so that the pool of thoughts is attracted. Regards.
With the exception of Image Effect components of course, but I’m just adding this just in case other readers get confused.
90% of the time it doesn’t matter however, As with scripts. The order to which the updates run depend on the order of the components top down. The top scripts update will run before the bottom exc… I found this out the hard way as i spent all day debugging my script just to find out the error was caused by the order of my scripts. If the order of your components matter you should change your code so thats not the case anymore as it just means you have bad code like me:)
I have tested execution order. There is no dependency of script order on the gameobject with script execution order.
public class A : MonoBehaviour {
private void Awake()
{
Debug.Log("=== A Awake ===");
}
private void OnEnable()
{
Debug.Log("=== A OnEnable ===");
}
private void Start()
{
Debug.Log("=== A Start ===");
}
private void Update()
{
Debug.Log("=== A Update ===");
}
}
public class B : MonoBehaviour
{
private void Awake()
{
Debug.Log("=== B Awake ===");
}
private void OnEnable()
{
Debug.Log("=== B OnEnable ===");
}
private void Start()
{
Debug.Log("=== B Start ===");
}
private void Update()
{
Debug.Log("=== B Update ===");
}
}

Then, how can you make the A script execute first?
You can change execution order either in the project settings or by using the [DefaultExecutionOrder] attribute on the behaviour class.
It’s been a long time since this post was made but this comment shows up as a Google answer.
I’m currently messing around with having two IUpdateSelectedHandler scripts on the same object and Component order seems to be used (rather than script execution order) for determining which script gets “Selected” first.
It seems like this is no longer true in all niche cases.
Component ordering is relevant when processing audio buffers using OnAudioFilterRead.
I found a post showing a solution using the undocumented class, ComponentUtility, which has functions to move, copy, and paste components via script. I extended MonoBehaviour to make the functions easier to use:
public static void MoveUp(this MonoBehaviour monoBehaviour)
{
UnityEditorInternal.ComponentUtility.MoveComponentUp(monoBehaviour);
}
public static void MoveDown(this MonoBehaviour monoBehaviour)
{
UnityEditorInternal.ComponentUtility.MoveComponentDown(monoBehaviour);
}
public static void Copy(this MonoBehaviour monoBehaviour)
{
UnityEditorInternal.ComponentUtility.CopyComponent(monoBehaviour);
}
public static void Paste(this MonoBehaviour monoBehaviour)
{
UnityEditorInternal.ComponentUtility.PasteComponentValues(monoBehaviour);
}
public static void PasteNew(this MonoBehaviour monoBehaviour, GameObject targetObject)
{
UnityEditorInternal.ComponentUtility.PasteComponentAsNew(targetObject);
}
public static void DuplicateOn(this MonoBehaviour monoBehaviour, GameObject targetObject)
{
UnityEditorInternal.ComponentUtility.CopyComponent(monoBehaviour);
UnityEditorInternal.ComponentUtility.PasteComponentAsNew(targetObject);
}







