how to draw a line in unity code example
Example: create line in unity
// you need the LineRenderer component in your object
var line = gameObject.AddComponent<LineRenderer>();
line.SetPosition(0, startingPoint);
line.SetPosition(1, middlePoint);
line.SetPosition(2, endPoint);