attached to a radar sensor I have the following code:
cont = logic.getCurrentController()
frontSonar = cont.sensors[‘front_sonar’]
detectedObjects = frontSonar.hitObjectList
for obj in detectedObjects:
dist = cont.owner.getDistanceTo(obj)
My problem is that getDistance will return the distance from the owner’s origin to the detected object’s origin but not the “real” distance between the two objects which would be the distance between the owner’s origin and the point where the radar beam hits the target. Is there any way to get this distance ?