of     1   

PrimeStarxxx
#226773591Tuesday, October 24, 2017 2:16 PM GMT

im making a gun and i need bullet travel my only problem is raycasting is unrealistic and is instant how can i fix this
helloburp
#226773723Tuesday, October 24, 2017 2:21 PM GMT

just take a normalized velocity based on a bullet speed and the gun barrel's lookvector and either add it to the bullet every so often or set it as the velocity in a bodyvelocity
PrimeStarxxx
#226773793Tuesday, October 24, 2017 2:24 PM GMT

but then that creates a problem which is taking damage as i herd that changing the position and using .touched dosent always fire
helloburp
#226773825Tuesday, October 24, 2017 2:25 PM GMT

yeah then use bodyvelocity
PrimeStarxxx
#226773854Tuesday, October 24, 2017 2:26 PM GMT

ok thx is bodyvelocity accurate on touched?
TaaRt
#226773864Tuesday, October 24, 2017 2:26 PM GMT

if you do use raycasting however you can simply apply a randomized inaccuracy; if you know the 'ideal' travel trajectory of a bullet you can model a less ideal one from it.
ScriptBased
#226773876Tuesday, October 24, 2017 2:27 PM GMT

Many gun games use raycasting, and they use body velocity and other stuff to make it look realistic, if you play for instance phantom forces. You can see all those bullets, and fire effects etc. They use either billboard gui, screengui or parts as for visual bullets
helloburp
#226773879Tuesday, October 24, 2017 2:27 PM GMT

it is because the part it is attached to wont be anchored
PrimeStarxxx
#226773974Tuesday, October 24, 2017 2:31 PM GMT

i rlly want to use raycasting cuz of its simplicity and accuracy but cant make it realistic
helloburp
#226774010Tuesday, October 24, 2017 2:33 PM GMT

you can't make a raycast not instant, that just doesnt make sense you could delay it i guess but that will just cause more frustration than anything else
ScriptBased
#226774082Tuesday, October 24, 2017 2:36 PM GMT

As I said, raycasting won’t be realistic, the effects is something you need to do on your own
PrimeStarxxx
#226774126Tuesday, October 24, 2017 2:38 PM GMT

ig ill just use bodyvelocity but thanks for ur help anyways :)
PrimeStarxxx
#226774422Tuesday, October 24, 2017 2:50 PM GMT

i think i found something, what if i just multiply how far the ray went after sometime ?
annabet_h
#226776760Tuesday, October 24, 2017 4:40 PM GMT

what i'd do is make two points when i shoot, one at the end of the nozzle and one a few studs in front of it going towards the target i'd then make a ray that goes through these two points. this acts as the bullet impact detector. if anything obstructs the ray, it hit something. if it hit something, point B is changed to the hit position i'd then make a neon part which goes from point A to point B, to visualize i'd remove the part then start the process again, with point A being the previous point B

    of     1