I’m interested to know how to draw a line in the game, not the in the editor and Debug Draw Line and such.
I need to find out if that line intersects with objects so I can reflect it upon the collision point. Imagine that I want to make a 2D game that there is a flash light and we can see the light beam coming out of it and when it hits a mirror, it gets reflected and so on.
I would use a LineRenderer for the visuals but I believe to find the length and reflection point you would need to use a Raycast. Anyway here is the documentation for the LineRenderer.