Quick Question About Scripts

Hey just wondering, if I have multiple scripts attached to multiple objects, are there ones that run first? I’m trying to decipher a code that I found and I’m unsure about the progression.

Here is the file, if it helps [ATTACH]317939[/ATTACH]

I think whether the code runs first or later depends on the sesnors you added to that controller. You can also mark a controller so that it runs before the other unmarked controllers.

Controllers within one object are executed from top to button (this belongs to actuators too).

The order of objects is undefined. This means it will be any order and you should never rely on it.
As there can be some rare situations to execute certain code first, you can enable the priority flag at the controller.

The order will be:

  • priority controllers (again in any order)
  • non-priority controllers

this means if you have more than one priority controller, you can guaranty the order too.

I hope it helps.