SOLVED Raycast object intersection (collision) check

Good afternoon, I’m trying to make a collision comparison with the Shape Painter which I have is a line. I found a topic where it is described that Shape has no collision and you can use Raycast, but how to count its intersection with the object?

Red objects move and a line object is created between them

P.S The crutch was invented. An invisible object launched from point a to b at a speed of 9999. But I would like to know more methods for beauty

Your diagram is confusing; which object do you want to check for a raycast collision - red or blue??

The object I want to check is blue

I think you can do something like:


Thanks, elegant solution.