Instantiate changes position

Aloha,

Right now i am fighting with a instantiate of an existing button and placing it some pixels above it…
alt text

So now i am just trying to copy this button via C# code…

public GameObject answerButton;
public GameObject canvas;
private GameObject answerButton1;
//
    
answerButton1 = Instantiate(answerButton,new Vector3(answerButton.transform.position.x, answerButton.transform.position.y - 50, answerButton.transform.position.z),answerButton.transform.rotation);
var rectTransform = answerButton1.GetComponent<RectTransform>();
rectTransform.SetParent(canvas.transform);

And that works actually…but the coordinates of this button…are screwed up :<
alt text

My problem is solved. You have to avoid putting a canvas into another canvas. Use Panels.