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 / Bullet Collision Dection

Author
Message
ChozoMufin
20
Years of Service
User Offline
Joined: 19th Apr 2005
Location: Columbus, OH
Posted: 4th Sep 2005 01:01
ok. i've got nuclear glory, but i don't know how to use it to get a bullet to recognise when it's hit an object. i tried using raycasting but it didn't work. what did i do wrong? do you have any better ways to do this?



Your Head A-Splode
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 6th Sep 2005 08:53
It looks like conflicting code there. Are you checking for bullet hits against the player or the enemies? You cast a ray against the player, but then decrease the unithealth (which I'm assuming is an enemy, correct me if I'm wrong). You also don't really need to create new bullets and use their coordinates as starting coordinates for bullets, you can just use players or enemies, then throw bullet objects down the path of the ray as an effect, doing the actual damage calculation via the ray cast.


I'm going to eat you!
ChozoMufin
20
Years of Service
User Offline
Joined: 19th Apr 2005
Location: Columbus, OH
Posted: 22nd Sep 2005 18:29 Edited at: 22nd Sep 2005 18:30
well PLAYER_OBJ reffers to the player, enemies, and basically all the soldiers.

i don't really see your point. it casts a ray 10 things ahead of the bullet (wich is how far the bullet moves, so basically it's predicting if it will hit the object) and if there is an intersection it hurts the thing it hits.

i think i see what you are saying with the throwing the thing down the ray, but i don't think it will change anything. the bullet doesn't travel the speed of light, so it won't reach the end of the ray in one sync, wich is what seems you are implying. plus, what if the player moves? so does the ray. the bullets shouldn't stay on the ray if you move, so it would be incorrect. and even if it didn't, it wouldn't solve my problem.

if you don't understand what i'm saying, just say so and i'll try to re-word it.

plus, i just got PRO, so if there is any better way to do this with pro that i haven't discovered yet please tell me.

Your Head A-Splode

Login to post a reply

Server time is: 2025-05-22 14:08:52
Your offset time is: 2025-05-22 14:08:52