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 / Help With Shooting in a 3rd Person Shooter

Author
Message
Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 5th Feb 2005 02:44 Edited at: 5th Feb 2005 02:56
Here is my shooting and collision code




I have 2 bugs with it.

1) When i press space the camera quickly flashs to where the bullet starts then back to normal

2) When the bullet collides with an object i get object does not exist at line 147

Also, i would like it so i use the mouse to look left and right and to fire. How can i do that?

Thanks in advance
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 5th Feb 2005 02:50
1) Put AUTOCAM OFF at top of program. Default behaviour is for camera to point to any newly created objects, like your bullet for example.

2) You need to wrap your bullet collision code with same condition as move bullet code, ie, only if bulletno =1. This is because you are testing for collisions, even when you have deleted bullet object.

You would be better off simply hiding bullet when not needed and showing it when you fire. This is because constantly creating and deleting objects is not very efficient.

Boo!
Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 5th Feb 2005 02:55
Thanks for solving problem one

But about hiding the object wouldnt that cause a problem if there was 2 enemies in a row as the bullet would hit both even though for hiting the 2nd one it was invisible?

Login to post a reply

Server time is: 2024-11-27 21:31:59
Your offset time is: 2024-11-27 21:31:59