Advertisement
metalx1000

Blender 3D Game - Get Distance To Object

Feb 1st, 2012
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. import bge
  2.  
  3. scene = bge.logic.getCurrentScene()
  4. owner = bge.logic.getCurrentController().owner
  5. ob2 = scene.objects['Sphere']
  6.  
  7. length = owner.getDistanceTo(ob2)
  8. print(length)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement