Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
1
Question by erebel55 · Jan 29, 2015 at 05:44 PM · uibuttonsscrollrect

Scrolling Scroll Rect with Buttons

I am trying to create something like the following for my level selection

alt text

So, I want to allow the player to scroll through the levels by clicking the left/right arrows.

By using Scroll Rect I can create something like this easily. However, I don't see a way to implement the buttons instead of a drag or scrollbar.

I tried creating two Buttons at a higher level than the Scroll Rect (so they aren't scrolled out of view as well).

However, I don't see what function I can call in my On Click in order to scroll the Scroll Rect.

Anyone know if this is possible?

Thank you

scroll.png (283.2 kB)
Comment
Add comment · Show 1
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 e4ajith · Jun 10, 2016 at 09:12 AM 0
Share

Any luck with this? Please share if you got something.

4 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by mingom · Feb 26, 2016 at 08:15 PM

use UI.ScrollRect.horizontalNormalizedPosition.

http://docs.unity3d.com/460/Documentation/ScriptReference/UI.ScrollRect-horizontalNormalizedPosition.html

Comment
Add comment · Show 1 · 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 mingom · Jun 10, 2016 at 01:37 PM 0
Share

Or use a coroutine and lerp the UI.ScrollRect.horizontalNormalizedPosition for the size of one element on each click. Need more details?

avatar image
2

Answer by Eloquentist · Oct 13, 2016 at 06:59 AM

This video explain how to do this:

https://www.youtube.com/watch?v=yC_LqOv2JDw

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
1

Answer by Brijs · Jun 10, 2016 at 12:09 PM

Modify ScrollRect.velocity property as per your need when you click button.

Set ScrollRect.decelerationRate for smoothness as per your need.

or change position of content of scrollrect

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
1

Answer by jinincarnate · Apr 09, 2020 at 02:37 PM

Anyone still looking for answer I created a github repository with a sample scene. here

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

7 People are following this question.

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

Related Questions

how to make UI Image inside Scroll Rect (ScrollRect) autoscroll? 1 Answer

Unity 4.6 UI button highlight color staying after button clicked 11 Answers

ScrollRect - Scroll outside the rect!? 0 Answers

How to play scrolling sounds when scrolling through ScrollRect? 1 Answer

4.6 UI Dynamic button event system PointerEnter, PointerExit, PointerUp etc. 1 Answer


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