hitObject
hitObject
Returns the game object that was hit by this ray.
Return type: KX_GameObject
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the ray sensor attached to the controller named
GuardDuty
ray = controller.sensors["GuardDuty"]
# get the game object hit by ray
gameObj = ray.hitObject
|