Ray curve for bullet gravity effect, or any way to make it

hey every one... i'm using raycast to shoot with my sniper, but it goes in a direct line... i want to make the gravity effect, but i don't know how to do it... if i could make a curved ray would be perfect, but i don't know how to do it. Some one can help me with this?

Thanks guys :)

more ▼

asked Apr 10 '11 at 06:37 PM

Leonardo T S gravatar image

Leonardo T S
37 5 5 6

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Do a series of short raycasts, and alter the angle slightly for each one so that it starts heading down over a longer distance. So basically it's approximately a curve, broken up into a number of straight segments.

more ▼

answered Apr 10 '11 at 07:28 PM

Eric5h5 gravatar image

102k 49 165 620

ok i think on that, but i was not sure with the performance... i will try that. Btw, it will take much process? Thanks

Apr 10 '11 at 07:47 PM Leonardo T S

It's naturally more expensive than using a single raycast, but since this is for a sniper rifle, you'd presumably only be doing it occasionally, and not hundreds of times per second, so it wouldn't be an issue.

Apr 10 '11 at 08:35 PM Eric5h5
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Apr 10 '11 at 06:37 PM

Seen: 1728 times

Last Updated: Apr 10 '11 at 06:37 PM