I found the initial formula on another post on here but it was relatively old and solved, so I’m making a new one.
I am trying to make a system that plays a supersonic crack if a bullet passes by you, and have found a formula that lets me get the closest point to my camera on a ray. However, it goes past the start and end points of where the bullet would be, which should not happen. How do I limit how far this point can go?
Video below:
Thanks in advance.