Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

text in scroll bar is "falling" - Pos Y keeps changing

Discussion in 'UI Elements' started by tvalleau, May 15, 2019.

  1. tvalleau

    tvalleau

    Joined:
    Jul 1, 2010
    Posts:
    105
    I have a GUI game object ("Help") which appears or disappears at a button press by the user. The hide/show is just a transform.localscale to zero or not.

    "Help" has a text container with a scroll bar. The scroll bar has a sliding area and a text object. It's this text object -in the inspector- that is weird.

    The whole thing works just fine. Click the button, the help text is transformed from zero to cover the screen; the scroll bar scrolls the text up and down; hit the button again, and it's transformed to zero, and hidden.

    But there's this weirdness: the Text's Rect Transform Pos Y is -1325 initially, but merely opening the project, much less running it, the Text's Rect transform Pos Y is forever changing before my eyes, becoming a larger and larger negative amount.

    It's weird because it happens whether I'm running the game, or just editing it. I can sit here in edit mode, and watch Pos Y going from -1325, to -1546 to -2000, to -23000 to -200,000... it keeps increasing.

    If I run the game, and transform the "Help" into displaying, the inspector text/rect transform/pos y stops changing, but the minute I hide the whole thing, the changing Pos Y starts up again.

    It's as if the text is a physics object and falling... either during play or during edit.

    Obviously some bone-headed thing I'm doing (or not doing) but I'm at a loss.

    Any suggestions?
     
  2. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    153