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.

Newcomers DBPro Corner / I need help getting my bullet to start in the right place

Author
Message
devastation
19
Years of Service
User Offline
Joined: 11th Aug 2005
Location:
Posted: 12th Aug 2005 03:36
I've searched the forums, and havent found any threads on this problem, but I appologize if there are and I've overlooked them.

I'm building a paintball game on the .x level collision demo with the bullet code from monster hunt. I've put in my paintball gun model and it's X position is 4, so it's off to the right instead of being in the middle. The problem was that teh bullet shoots different directions depending on which direction you're turned. How would I get the bullet to start behind the gun model and shoot out the direction the gun model is pointing?

Thanks in advance.
Heckno
20
Years of Service
User Offline
Joined: 8th Sep 2004
Location: Palm Coast, FL
Posted: 12th Aug 2005 06:44
for first person shooters I think you need to work in the -set object to camera orientation command - ....

Also you may have to offset the bullet (paintball) starting position to get it to appear as if it was shooting out of your Angel, Spyder, Model98 etc...

by combining the two, set object to camera & tweaking the starting position you should be able to get the paintball to start from the right side of the screen angled back to the center of the screen...
Louiz ofRohr
19
Years of Service
User Offline
Joined: 11th Nov 2004
Location:
Posted: 12th Aug 2005 06:46
first, position the bullet object in the same position
of the gun and rotate the bullet as the gun's rotation..



this is surely gonna put the bullet in the right place and
prepare it to move in the right direction..

good luck..

The worst foe lies within the self...
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 12th Aug 2005 17:28
I see what your problem is, you locked the gun on the screen so the position object wont work.

Use this:

-not tested-

Immunity and Annihalation makes Immunihalation...
devastation
19
Years of Service
User Offline
Joined: 11th Aug 2005
Location:
Posted: 13th Aug 2005 06:45
Sweet! Thanks a ton guys! I'm gonna go put that code in right now. Much appreciation!

Jeff
devastation
19
Years of Service
User Offline
Joined: 11th Aug 2005
Location:
Posted: 14th Aug 2005 03:13
The bullet starts near the camera position now, but I still have the problem with where the bullet starts in relation to which direction i'm facing. I'm not too good at wording, but I'll try to describe this. The bullet starts at 4 units from teh camera's x position every time it loops, and stays there. Imagine a ball floating one foot to your right. Now imagine turning left. The ball would be behind you if your life was running in my code (god forbid). If you took a step, the ball would be one foot behind you. If you turned right, it would be one foot from you. The bullet rotates fine and shoots the direction I'm facing, but it still won't work right. The bullet's start position won't "swing around" as I rotate.

I'm thinking that the solution to this involves some math with the angle I'm facing, but that math is probably taught in a class that I can't pronounce. Anyone know how to get the starting position to stay to the right of the angle you're facing?

Thanks in advance again!

Login to post a reply

Server time is: 2024-09-24 01:33:44
Your offset time is: 2024-09-24 01:33:44