- Home /
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 :)
Answer by Eric5h5 · Apr 10, 2011 at 07:28 PM
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.
ok i think on that, but i was not sure with the performance... i will try that. Btw, it will take much process? Thanks
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.
Your answer
Follow this Question
Related Questions
RayCast Problem : 2d 1 Answer
Bullet Effect 2 Answers
Simulating gravity to Raycast bullet 3 Answers
Need a script for a gun that shoots bullet using raycast 2 Answers
shooting problem with raycasting 1 Answer