Search Unity

"Rect" of button shows wildly different X,Y coordinates in build

Discussion in 'UGUI & TextMesh Pro' started by RickEllis, Dec 10, 2016.

  1. RickEllis

    RickEllis

    Joined:
    Dec 10, 2016
    Posts:
    6
    When I run the game in editor doing:

    button.GetComponent<RectTransform>().rect

    give me what appear to be "valid" coordinates for the X/Y coordinates of the button (something like 71, 22). However, when I run the game as a build, the X/Y coordinates return as something like -80, -410.

    Any clue why this might be happening?

    Thanks!