Sensor Logic Brick: executePriority

executePriority
  • get/sets the execute priority of the logic brick.

Type: 
  • integer

Range:

  • 0 (highest) to 100 (lowest)
Sensor Logic Brick:
  • Logic bricks with the highest priority will be executed before logic bricks with lower priority.
     
  • Overriding actions (higher priority) must be lower in the stack.
Sample Code


################  get the execute priority  
 
# import bge module

import bge

# get the controller
cont = bge.logic.getCurrentController()

# get the sensor attached to the controller
# my sensor is named Sensor_1

sen = cont.sensors["Sensor_1"]

# get the execute priority
priority = sen.executePriority
 
Sample Code


################  set the execute priority
  

# import bge module
import bge

# get the controller
cont = bge.logic.getCurrentController()

# get the sensor attached to the controller
# my sensor is named Sensor_1

sen = cont.sensors["Sensor_1"]

# set the execute priority
sen.executePriority = 1