

axis
- gets/sets the game object Axis that the ray uses
- integer
Values:
- 0 = positive Y axis
- 1 = positive X axis
- 2 = positive Z axis
- 3 = negative X axis
- 4 = negative Y axis
- 5 = negative Z axis
Ray Sensor:
- Ray Sensor is triggered when the first game object is detected.
- Ray 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 ray.
# import bge module
import bge
# get the controller
cont = bge.logic.getCurrentController()
# get the sensor attached to the controller
# my sensor is named Tripwire
sen = cont.sensors["Tripwire"]
# get the axis of the ray
ray_axis = sen.axis
Sample Code

################ Set the axis of the ray.
# import bge module
import bge
# get the controller
cont = bge.logic.getCurrentController()
# get the sensor attached to the controller
# my sensor is named Tripwire
sen = cont.sensors["Tripwire"]
# set the axis of the ray
# positive X axis is 1
sen.axis = 1