Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
30
Question by RyanAchtenSoma · Oct 27, 2015 at 09:05 PM · uitextrectscrollbarscroll view

Scroll rect starting in the middle

Hi Unity Community

I am trying to create a scroll functionality for text which is updated at runtime using the scroll rect and UI scrollbar. This works, however it currently starts with the Text rect positioned at the middle, whereas I obviously want this to be positioned at the top.

It’s a small but annoying issue that I can’t seem to solve using the Unity UI system. Any advice would be very welcome on how to resolve this.

Cheers, Ryan

Current start position (text rect): alt text

Text Editor Setup: alt text

screen-shot-2015-10-28-at-94905-am.png (47.2 kB)
screen-shot-2015-10-28-at-95125-am.png (56.5 kB)
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image RyanAchtenSoma · Oct 27, 2015 at 09:07 PM 0
Share

The text rect is governed by the scroll rect whose setup is detailed below:

Scroll Rect Editor Setup: alt text

screen-shot-2015-10-28-at-95143-am.png (40.9 kB)
avatar image Cherno · Oct 28, 2015 at 12:48 AM 0
Share

If all else fails, you can set the ScrollBar's Value manually in Start().

avatar image RyanAchtenSoma Cherno · Oct 28, 2015 at 04:22 AM 0
Share

@Cherno yeah I tried that; as the text field is updated at runtime this seems to be overridden by some of the inherited properties from parent Layout components...can't seem to work around them

3 Replies

· Add your reply
  • Sort: 
avatar image
105
Best Answer

Answer by digzou · Oct 28, 2015 at 07:05 AM

Set the 'Y' Pivot of your description text to '1' if you want it to align to top. It is aligning to centre since your pivot y value is 0.5. Here's copy of my scrollContent if you need for some help.

alt text


scrollrect.png (42.8 kB)
scrollcontent.png (47.7 kB)
Comment
Add comment · Show 8 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image RyanAchtenSoma · Oct 28, 2015 at 08:53 PM 2
Share

@digzou thank you so much! Setting the Text rect pivot to 1 solved the issue.

avatar image Firemaw RyanAchtenSoma · Apr 17, 2018 at 01:50 AM 1
Share

Thank you @digzou I'd been trying to figure this out with a similar scroll panel setup!

avatar image AbdulRaman · Jun 07, 2018 at 09:37 PM 2
Share

Thank you so much

avatar image Vishvesh8 · Dec 25, 2019 at 03:47 AM 0
Share

Thank you so much!

avatar image cupcake007 · Feb 27, 2020 at 09:36 PM 0
Share

Thank you so much! You are truely a life saver. Beautiful human.

avatar image SanyaBane · Jun 27, 2020 at 09:46 AM 0
Share

Thanks a lot. I've wasted so much time playing with layouts to make it work.

Show more comments
avatar image
0

Answer by Refugio3D · Nov 24, 2019 at 02:48 PM

Perfect,thanks soo much

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by hendryshaikh2004 · Apr 23, 2021 at 12:39 PM

Thanks Mate This helped a lot

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

53 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I Make TextMeshPro InputField scroll through code? 0 Answers

Changing the scale of the scroll view 1 Answer

How to scrolling scrolling panel using Script or Keyboard 1 Answer

My scroll view always scrolls to the bottom automatically. 3 Answers

4.6 UI Text rect does not expand automatically 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges