Controlling the order in which behaviours update

Is there a way to specify the order in which behaviours update? If I have two behaviours on a gameobject, one of which moves the object, and the other does something based on the object's position, then the order in which they run will determine whether the second script is a "frame behind" or not. Is there any way to determine the order? Is it simply based on which behaviour was "added" to the gameObject first?

Thanks!

There is no way to control the order of things that happen in Update or FixedUpdate. You can always pass function+parameters though. (As in, instead of using Update() in one script, you use another function that is triggered by something happening in Update() elsewhere.) There are probably a bunch of other ways of handling that sort of thing.

However, it sounds like your problem can be solved simply, by using LateUpdate.

This functionality has since been added. I’m not sure when, but it is there as of version 4.6.

Here is the documentation page: Unity - Manual: Script Execution Order settings

You can find the Script Execution inspector by going to this menu: Edit->Project Settings->Script Execution Order.

You can also get there by clicking “Execution Order…”, which shows up by default as a button on the inspector for any script.

That is not possible. The components are updated at "random" order and your game logic should not depend on which one is being updated first. You should make your scripts modular enough so that they do not depend on other scripts execution for that particular frame. Your scripts can communicate using public variables and functions tough.