Script Execution Order

The network methods on your Network Behavior classes are called from inside Netick, which means standard Unity MonoBehaviour script order control does not work here. To specify the order of execution for classes inheriting from Network Behavior, use the attributes:

[ExecuteAfter(typeof(SomeOtherScript))]  /* to specify that this script executes after SomeOtherScript) */
[ExecuteBefore(typeof(SomeOtherScript))] /* to specify that this script executes before SomeOtherScript */

Example:

 [ExecuteAfter(typeof(SomeOtherScript))]
 public class BomberController : NetworkBehaviour 
 {
      // ... 
 }

Last updated

Was this helpful?