Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Problem with shooting?

Author
Message
Lzdude69
21
Years of Service
User Offline
Joined: 21st May 2004
Location: Indiana
Posted: 4th Aug 2004 05:50
I need help make an effective way of shooting a bullet in an FPS. The I have it, is when the bullet reaches so far the bullet is hidden and the distance vriable is set to zero, the distance variable has to be set to zero before it can shoot another bullet.


My problem is, when the player reaches a certain point, (however far the distance is before the bullet is deleted) the bullets keep shooting faster and faster, until they stop, and well that's not how it is supposed to be, if anyone could help, I would be extremely grateful

Im with stupid...
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Aug 2004 06:10
Your distance is absolute - that's the problem. So if you are stood at x = 0, or x = 39999, the bullet still stops at 4000. in So scenario 1, the bullet would travel 4000 units, in scenario 2 it would travel 1 unit.

Try using

if object position x(bullet)> camera position x() + 4000

instead.

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
Lzdude69
21
Years of Service
User Offline
Joined: 21st May 2004
Location: Indiana
Posted: 4th Aug 2004 11:11
Thanx dude, so simple, thanx again.

Im with stupid...

Login to post a reply

Server time is: 2025-05-25 16:37:56
Your offset time is: 2025-05-25 16:37:56