Im trying to cast a ray in python.
The ray works, but it seems to hit the last face instead of the first face.
Code, executes from Always sensor with frequency 0:
import bge def main(): cont = bge.logic.getCurrentController() own = cont.owner px = own.worldPosition.x py = own.worldPosition.y pz = own.worldPosition.z xx = own.rayCast([px-1.0,py,pz], [px-1.0,py+10.0,pz], 10.0, "") if xx: print('test: '+str(xx)) bge.render.drawLine([px-1.0,py,pz], xx, [0,255,0]) main()
Move object with arrows to test.
Im not sure how to solve this. Thanks for any help.