GUI.Button stuck in top left of screen

So I have this code:

   if (PlayerGUI)
   {
        GUI.Button(new Rect(-1, 0, 40, 30), "Draw");

        for (int i = 0; i < hands[3].cards.Count; i++)
        {
            Vector3 pos = new Vector3(hands[3].cards*.gameObject.transform.position.x,* 

hands[3].cards*.gameObject.transform.position.y, 0);*
if (hands[3].cards*.rank == wastepile.cards.First.Value.rank ||*
hands[3].cards*.suit == wastepile.cards.First.Value.suit)*
{
GUI.Button(new Rect(pos.x, pos.y, 40, 30), “Play”);
}
}
}
And the problem I have been having is that the buttons are being made on top of eachother in the top left of the screen. Any ideas?

You are using your gameobject’s world position to draw your buttons, but the Rect in GUI.button uses screen space in its arguments. Convert your card’s position to screen space.