Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Stop ScrollView Content rect from overriding prefab?

Discussion in 'UGUI & TextMesh Pro' started by Zarkow, Jan 7, 2019.

  1. Zarkow

    Zarkow

    Joined:
    Jul 27, 2015
    Posts:
    38
    I have a UI defined and made into a Prefab.

    As part of this overlay UI with character and game-info I have a pretty standard 'Scroll View' area, where I show basically the log of activities (as many RPG's do) of the characters.

    I have not changed the hierarchy one get from doing RMB->UI->Scroll View, all very standard.

    I then use the UI prefab in a scene.

    On the first run the content of the area (pre-populated by default value and/or test-values at startup) and showing the last line (i.e. scrolled all the way down) just like I want it.
    When I exit the Player in the editor, the third hierarchy-item 'Content' has its Y-value changed from defined -100, to -340 (scrolled all the way up). This value is overriding the prefab value. It is then kept when I launch the game in the Player in the Editor again. This is *not* the expected behavior.

    Is there any I can prevent these basic components from setting new values on their own, i.e. when exiting the Play mode, and thereby overriding the Prefab and ignoring it for any future runs?

    Edit: using 2018.3.0f2 (Plus user)
     
    Last edited: Jan 7, 2019
unityunity