Bullet ricochet - minimal angle

I create realistic bullet physics based only on raycasts. Now I make bullet ricochet. Ricochet works well, but I’d like to limit the angle at which the projectile will bounce. At the moment of bullet hit I get hit direction and ricochet direction. How can I limit this if eg. hit angle is less than 20 degress bullet will bounce, otherwise won’t.


Direction = (0.2, 0, 1.0)


Direction = (0.9, 0, 0.3)

Simply use the Vector3.AngleBetween() Function to check and limit the angle;)

1 Like

I used Vector3.Angle instead of Vector3.AngleBetween ('cause AngleBetween is obsolete) and it works great. Thank you so much bro :smile: .