Bullets with ray sensor?

I’ve seen a couple of comments suggesting the use of the ray sensor for bullet detection, since collision for high speed objects can be a bit tricky. Can anyone explain a good way to set this up? I haven’t played with the ray sensor much, so I’m not sure how best to use it.


in python you can get from the ray sensor:

  • if it has hit something of the specified property
  • where
  • the normal of this point
  • the object it hit

so you could quite easily subtract from the life of the other object, you just need to get a ray sensor tracked on them [a ray sensor attached to the camera? sure, why not], and notice when they press some button [say the left mouse button]

check out the logic in http://home.earthlink.net/~nwinters99/temp/fps_controls.blend [it’s for door opening/closing but could easily be applied to shooting]