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 / some problems with sc_raycast collision

Author
Message
Danny FPS
14
Years of Service
User Offline
Joined: 17th May 2010
Location:
Posted: 25th Jun 2010 13:27 Edited at: 25th Jun 2010 17:00
Hello there. i'm trying to make a fps in dbpro, using scraps of code from many users here in the DBpro comunity. Everything worked like a charm until i've tried to make a sc_raycast collision to make a basic damage code for an enemy. It seems that everywhere i point the gun the enemy still takes dmg. Are there any alternatives for the damage code? Here's the code:



The part of the code that i'm refering to is this


If anyone can help me it would be greatly apreciated.
Dia
19
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 25th Jun 2010 19:05
I didn't wade through all of the first code snippet, but looking at the second it appears as if the ray cast you are using is from the player's position to the target position, so the direction the player is facing is not considered.

I don't knpw how anyone else does it, but for shooting I use a dummy object for shooting, which is positioned based on the heading and pitch of the target cursor. I then used the x y and z positions of that dummy object as the inputs to the sc_raycast

This is not the Sig you are looking for....
Danny FPS
14
Years of Service
User Offline
Joined: 17th May 2010
Location:
Posted: 25th Jun 2010 19:49
Could you please exemplify with some code? I've created the object the dummy but i'm having problems positioning it. Should i link it to a limb?
Thanks for the answer anyway.
Danny FPS
14
Years of Service
User Offline
Joined: 17th May 2010
Location:
Posted: 27th Jun 2010 18:24
Nevermind, i got it working. Thanks for the ideea Dia.

Login to post a reply

Server time is: 2024-09-28 18:25:26
Your offset time is: 2024-09-28 18:25:26