In Unity2D , Use LineRenderer draw a line,than I Want to add an object on the center position of the line.what can i do ?
The center position of a line is Halfway in the line.
To get the line distance itself create a new Vector2 equal to the first point you use for LineRenderer and add the second point on a X and Y basis then divid by two.
Vector2 midpoint = new Vector2 ( (pointOne.x + pointTwo.x) / 2 , (pointOne.y + pointTwo.y) / 2);
Instantiate (newObject, midpoint, newRotation);
Good Luck!