Rays

Hello everyone i am in the process of making a fps tutorial in blender. i know how to do most of it but i was planning to use the old method of the empty spawning a sphere with a collision actuator. BUT this method is old and creates lag. I was wondering if someone could tell me how to do the ray method. i know i probably shouldn’t be doing this series for i’m a blender noob myself, but i wish to help people and i don’t want to stop half way through a series. thanks for your help.
Please dont be to harsh on the crits that i know will come

http://www.tutorialsforblender3d.com/GameDoc/LogicBricks/Sensors_10.html

http://www.blender.org/documentation/249PythonDoc/GE/GameTypes.KX_GameObject-class.html#rayCastTo

http://www.blender.org/documentation/249PythonDoc/GE/GameTypes.KX_RaySensor-class.html

If you know what its called there is nothing stopping you doing some searching.

-Set up a ray
-When firing: check ray for any hits
-If hit: deduct health, play hit animations, bullet holes ect

Sometimes the best way to help others, is to help yourself first. Also, you should not write tutorials on things you obviously don’t understand, because you’ll just end up confusing others.

The links posted by andrew are valuable resources, so use them.

If you’re looking for applying physics forces resultant from bullet impacts (using the ray method), I’ve made a small demo for you (attached)

PS:

Since when does applyImpulse() need local coordinates? Why was that changed?

Does anyone know?

Attachments

RayBullet.blend (200 KB)

Social, you’re nice scripts/demos don’t work in the new 2.5 version!

Sounds like a blender problem. :smiley:

Wha do the applyImpulse() methods do?

…just read the function name.

It’s self-explanatory.

Social I tried to incorporate your ray method into my game but for some reason it does not work.

The zombie is the the shootable object.

http://www.filefront.com/14994447/apocalypsebuildray.blend.zip

Edit:
Social’s awesome