Projectile Firing Help!

Alright so I’m trying to develop an FPS game, but first Iam trying to understand the basic setup (before I develop a story/plot)

I have movement, mouselook, recoil, and clips/ammo counter all set up. My trouble is that I can’t figure out how to fire bullets.

Here’s my .blend, please help me out…:o


FPS on my own1.blend (263 KB)

this is my take on bullets-

edit object- add object actuator , set to local ,to instance a projectile that lasts a limited amount of time and has a property assigned to it, so it can affect other objects the right way(see health bar tutorials). you can put the projectile on a separate layer if you want to.

add some planes with alpha for the gunfire/smoke coming out of the barrel

In real life there are no real bullets, as they are invisible to the human eye.

It’'s your call, depending on the type of game you want to create.

Also, check this out-the ray sensor -

THanks a lot, It works!

But another problem, now it shoots bullets, but the bullets often don’t hit correctly.

Here’s my game, please help me out…


FPS on my own1.blend (275 KB)

For a FPS game which does not require the player to see the bullets (machine gun vs missile) you should use a ray instead of bullets to determine what gets hit when you shoot stuff.

The principle:
The gun (or an empty) projects a ray forward. If the ray sensor is positive and the trigger sensor is positive (your shot hit something), then “gun response” stuff happens. This means creating bullet holes, moving objects, and killing bad guys.

Ok so how would I make the object move back (force along local -Y axis?) and how would I add bullet holes?

that way requires a very custom script. another thing you could do is give your bullets the logic to act upon collision

here let me see what i can do with your .blend and ill get back to you.

Alright thanks so much, I’ll keep an eye on it.