• 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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
Question by Babacool123 · Jul 08, 2015 at 08:59 AM · diagonal

ScrollRect : enable only diagonal scrolling

Hi

By default, the ScrollRect permit to disable/enable for Vertical and Horizontal scrolling.

I have a menu that have multiple screen. And to navigate through the screen I use a Scroll Rect. The camera doesn't move, it's the panel that contains the screens that move. This is my situation : image

The black rectangles represent the screens, and the gray lines are the transition by scrolling between the screens.

I have managed to create the transition between 2-3 and 3-4, by just set the Scrollrect.horizontal = true and the 1-3 by Scrollrect.vertical= true

But how can i enable the diagonal scrolling for 1-2 and 1-4 ?

I already tried to rotate the scrollRect, and enable only horizontal. But the scroll content panel is also rotated because it is child. So I created a function that before rotating, unchild the content and rechild after the rotation. It worked nearly, it has still a problem, the content "jumps" after rotating. : http://puu.sh/iQxSF/52843ba905.gif

Thank you for you help

Comment

People who like this

0 Show 6
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 fafase · Jul 08, 2015 at 09:05 AM 0
Share

I think scrolling rect is not your solution here, more likely animation. Your drawing would be the FSM of the animation, you would just have to create the animations. Simple translations would do.

1 to 2 and 4 to 1 would move on x and y axes while the two others would move on the x axis only.

Then an Animator and calling the animation on bool condition.

avatar image Babacool123 · Jul 08, 2015 at 09:52 AM 0
Share

Yes, I've already thought about using animation. But I will lose the scroll aspect : I would like to allow the user to drag the screen. But with animation, when the user swipe, the animation will trigger and it's not as smooth as a scrolling.

avatar image Bunny83 · Jul 08, 2015 at 10:35 AM 0
Share

I wouldn't recommend such a strange setup at all. It's counter intuitive. When you're on "1" and go left you would end up on "2". Every user would expect when he goes right when on "2" he get's back to where he came from but you'll end up on "3" instead.

What do those screens represent? What's the relation between them?

avatar image Babacool123 · Jul 08, 2015 at 11:40 AM 0
Share

No, when you swipe to the right from "2", you will not move because you are already on the leftest side of the menu. You have to swipe to the bot(drag from top to bot) to go to screen 1. And the screens are different part of the mainmenu. For example screen 3 will have the button to go playscene, screen 4 to options, screen 1 to buy items ...

avatar image Bunny83 · Jul 09, 2015 at 01:37 AM 0
Share

@Babacool123: Uhm that's exactly what i said. This is counter intuitive. Also i said "when you go to the right", not "when you swipe to the right". Swiping to the right would probably mean "go to the left".

The point was if you do one move you get from one page to the other but when you do the reverse mvoe you don't get back. So when you are on page1 and you swipe left or right you end up on either page2 or page4. But when you do the reverse move on those pages you will get to page 3 instead of back to page1. No one would expect that. Like when you scroll down a webpage and then scoll back up to the top and you'll see completely different content now.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How convert to camera FOV from diagonal FOV? 0 Answers

Controlling speed of diagonal navmesh movement? 1 Answer

C# rigidbody.velocity diagonal movement 0 Answers

Detect diagonal movement? 0 Answers

How to disable diagonal movement? 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