Please help me achieve this

red line is where raycast direction point.

green circle is where mounseinput is

i want to draw a line like that or where the raycast direction is hitting the same object on intersection.

i already have a raycast matching object with same tag then destroy.
what i want is i wanted to draw a line the pointing to the direction like raycast.

125577-fffffff.png

Use a LineRenderer component. Create an empty object in your hierarchy, add a LineRenderer component to it. When you want to draw a line, set the LineRenderer.positionCount to 2, then use LineRenderer.SetPosition or LineRenderer.SetPositions to set the position of your start point and end points.