Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

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

Discussion in 'UGUI & TextMesh Pro' started by tvalleau, May 16, 2019.

  1. tvalleau

    tvalleau

    Joined:
    Jul 1, 2010
    Posts:
    108
    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. tvalleau

    tvalleau

    Joined:
    Jul 1, 2010
    Posts:
    108
    turns out that it was because the size of the object was 0,0,0. When I made the size 0.0001, 0.0001, 0.0001, the object quit falling.