Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How do I get the impact angle of a ray?

Asked by 6 years ago

I'm making a gun script, and I want to add a realistic-ish ricochet, where if the impact angle is under a certain number, it will bounce off. The part I'm having trouble with is finding the impact angle.

I know that I have the hitnormal of the ray, but after playing around with that I couldn't find any correlation between that and the impact angle of the bullet. (I couldn't find anything on the internet either.)

Just a note: My gun uses tons of rays to simulate an arc, so the rays are pretty small.

0
epic TheluaBanana 946 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Here check this thing https://www.robloxdev.com/articles/Calculating-Dot-Products

Ad

Answer this question