

hitPosition
- Returns the position (in World Coordinates) where the object was hit by the ray
- float List [ x, y, z]
x:
- x world coordinates
- y world coordinates
- z world coordinates
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

################ Find position where the object was hit by 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"]
# position where the object was hit by the ray
pos = sen.hitPosition