Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by zsydeepsky · Nov 18, 2014 at 04:03 AM · gui

in 4.6RC1 uGUI, sprites blocks buttons/scrollrect from clicking/scrolling

(sorry my English wasn't very good...) I built a scene with 4.6 RC1, as the pictures 1 & 2

picture 1: alt text

picture 2: alt text

players could scroll the scene to left or right to see more levels(by using a invisible ScrollRect) each level was Instantiated from prefab, put under a GridLayoutGroup, and contains a button for player to click at the front side were sea waves.

now here comes the problem: 1. for now, i put scrollview behind level buttons and sea waves. so only 1/3 of the screen could respond the scroll, even the sea waves would block the scrollview 2. if i put scrollview before level buttons, i can't trigger buttons any more. any idea how to make them together peaceful?

ps: i also try to settle this problem through physics2D layer collision matrix, but didn't work (or maybe it's my own problem beacuse i'm not quite understand it yet) and i also tried setting the GraphicRaycaster script on canvas, but also didn't change anything(and that's really wired)

1.png (359.8 kB)
2.png (256.5 kB)
Comment
Add comment
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

2 Replies

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

Answer by troien · Nov 18, 2014 at 08:56 AM

For the waves in the front, you should check the answer I gave to this question.

As for your buttons, maybe you'll need to write your own ICanvasRaycastFilter. But I'm not sure what you are trying to achieve. Since how do the buttons and the scrollrect need to co-operate, and how do they work now (If you put buttons in front of scrollrect)

Comment
Add comment · Show 3 · 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 zsydeepsky · Nov 18, 2014 at 10:18 AM 0
Share

thank you so much, the first problem was solved!

to the second part, i'm trying to make a scrollview that covers the whole screen yet i can still click on the level button. i checked the scripting reference of ICanvasRaycastFileter, and it looks excactlly fit my purpose, but i couldn't find further instructions on how to use it in code...how should i use it? was there a demo?

avatar image troien · Nov 18, 2014 at 11:20 AM 0
Share

Is the purpose of the scrollview to scroll the level buttons?

If so, I created a test scene with this hierarchy

alt text

And these values in the Inspector alt text

Now the result looks like what you describe you want. The black background image won't scroll, but is needed as a child of the Scrollview. Otherwise you can only drag the buttons. With the image you can drag the buttons by dragging the image if I'm still making sense right now :p

Edit: I guess what I'm trying to say is, make the buttons a child of the scrollrect. Because I think implementing the ICanvasRaycastFilter is something you usually don't need to do sinse Unity has better alternatives. I haven't found any instructions how to use it other than the link to the docs. I did make a example in another answer to a question before. But in that case there also was a better alternative by changing the hierarchy in my opinion.

scrollrect_inspector.png (73.7 kB)
scrollrect_hierarchy.png (5.0 kB)
avatar image zsydeepsky · Nov 19, 2014 at 11:18 AM 0
Share

Thank you so much, i tried it and it totally works. It's my mistake by spliting ScrollRect and Buttons into two parts

The example about iCanvasRaycastFilter you gave is also a great help, again, thank you a lot!

avatar image
1

Answer by yuriythebest · Aug 19, 2015 at 02:00 PM

Hey guys! Just had a lot of problems with this - in Unity3d 5 event triggers will NOT work (you won't be able to drag) - use good ole buttons!!!

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to display texture field with label on top like the "Add Terrain Texture" window? 1 Answer

GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced) 2 Answers

Destroy text 1 Answer

Rect with a height of 0 has a non-zero height 1 Answer

changing from mouse click to keys 0 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