Radar Sensor: axis

axis
  • gets/sets the game object Axis the radar cone uses

Type: 
  • integer

Values:

  • 0 = positive X axis
     
  • 1 = positive Y axis
     
  • 2 = positive Z axis
     
  • 3 = negative X axis
     
  • 4 = negative Y axis
     
  • 5 = negative Z axis
Radar Sensor:
  • Game object being detected must have Actor enabled.
Properties menu >> Physics button >> Physics Type >> Actor checkbox
  • Radar Sensor is triggered when the first game object is detected.
  • Radar Sensor is reset when all game objects are no longer detected.
  • Triggered:  One positive pulse is sent to the connected controller(s).
  • Reset:  One negative pulse is sent to the connected controller(s).
Sample Code


################  Get the axis of the radar cone.

# import bge module
import bge

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

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

sen = cont.sensors["Search"]

# get the axis of the radar cone
radar_axis = sen.axis
 
Sample Code


################  Set the axis of the radar cone.
 
# import bge module
import bge

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

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

sen = cont.sensors["Search"]

# set the axis of the radar cone
# positive X axis is 0
sen.axis = 0