lr.SetPosition(0, new Vector3(this.transform.position.x, this.transform.position.y, -0.1f));
lr.SetPosition(1, new Vector3(Obj2.transform.position.x, Obj2.transform.position.y, -0.1f));
public LineRenderer lr;
..............................
public void Test(){
if(Obj2 != null){
lr.SetPosition(0, this.transform.position);
lr.SetPosition(0, Obj2.transform.position);
}
}
PressButton(string str){....