Line Renderer not rendering on the exact spots

The desire outcome is trying to render a line from the left rock to the right rock. However, that’s not happening when i start moving the right rock (on the lower image).

This is the script:

LateUpdate() {
		//Control the line renderer effect
		if (thisAster == AsteriodType.Electric && lr != null) {
			//stretch the line a bit on the x axis.
			lr2ndPosiAdjus = new Vector3(elecEnd.localPosition.x * 10, elecEnd.localPosition.y * yAdjus , 0);
			lr.SetPosition(0, transform.localPosition);
			lr.SetPosition(1, lr2ndPosiAdjus);
//other stuff.....

The screenshot above is when I am using lr2ndPosiAdjus, which my botched attempt in making the line a bit longer.

I have also tried using different method like (without using lr2ndPosiAdjus, just transform.position for both positions):

  1. Using transform.localPosition for both setPositions. The result is something like it start at the correct position on the right rock, but only lenghten 10% of the length shows in the image.
  2. Using transform.position has a similar effect as point 1, but also making the renderer start sort of like 2 units above the right rock.

Am I doing something wrong or simply LR is not what I’m looking for?

Fixed, using only transfrom.position for both ends and I found out that I haven’t checked ‘use world space’.