Python script to shoot a bullet raycast?

Alright, I’m no good with Python. I’m not gonna deny lol. Here’s what I want: a script to shoot a raycast and have that raycast act as a bullet. As we all know, FPS games use raycasts, not physical bullets. So, this is what I want. Anyone got something for me?

P.S. Don’t worry, I will try to get the hang of Python!

check it :smiley:

spacebar= remove health at a distance

about python

check out “GameLogic Simple” template in the editor, it is your key to the universe.


SimpleRay.blend (435 KB)

Nifty. Thanks. I’ll be trying to edit that to fit my needs!

As a side-note, did you search the forum? This is a very common question, and has been asked really recently.


No, I always forget there’s a search feature! I tend not to look anyway. :spin:

here is a bit more data from the sensor


LessSimpleRay (1).blend (456 KB)

Thanks BluePrintRandom. Now I just need to make it stop once I’m out of ammo.

EDIT: Got it! With a little editing of the script, all’s well! Thanks!

No Problem,

:smiley: Well this post is pointless. Lol.

Well this post is even more pointless,
Except to say, I have been toying with a weapon managment sytem template,
So we can dump weapons in a thread, and any game using
The template could use.

Its based a parent being the weapon manager, and the gun/child logic triggered by the parent, this way any weapon parented to the weapon manager looks up its ammo with a property called MyAmmo

So its already written but its like machine code, I need to strart naming and commenting more.

Sounds nifty! Keep me updated please! :wink: