How to make intersection "line vs box" without penetration many objects?

28 views Asked by At

can someone give me idea how can i make intersection only first box when the line is stretched to mouse cursor? Im trying to make something like "raycasting" but don't know how to stop the line.

https://i.stack.imgur.com/0CzpW.png

I tried line-line intersection but don't know how to find proper wall of the box

0

There are 0 answers