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
1
Question by mkleinSTS3D · Jun 01, 2016 at 02:46 PM · uicollidercanvascollidersworldspace

How to stop collider from interfering with world space canvas?

Hi all!

I have a canvas that is in world space and a normal box collider behind it. But my buttons cannot be clicked because of the collider behind the canvas (and the collider/object is definitely behind the canvas). How can I make the canvas be in front of everything including colliders?

Thanks

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 Eudaimonium · Jun 01, 2016 at 03:03 PM 0
Share

It doesn't seem like the collider behind the canvas is the problem...

Can you click the buttons if there is nothing behind the canvas? How are your layers sorted? For any world space canvas that I have I always make sure they're on a dedicated UI layer so no raycasts that are meant for world objects interact with them, and no UI raycasts interact with anything in the world.

avatar image mkleinSTS3D Eudaimonium · Jun 02, 2016 at 06:31 AM 0
Share

yeah, it does work if nothing is behind it. And the canvas is on the normal UI layer (I haven't changed anything with how the layers are sorted). So you say it should not be on the normal UI layer?

avatar image Eudaimonium mkleinSTS3D · Jun 02, 2016 at 10:28 AM 0
Share

How is your camera system set up? Is the same camera used for both world and for UI layer? Try using one camera for world and everything except UI, and another camera with larger Weight property (so it's drawn later), with Clear to Depth Only, and it only renders the UI layer and nothing else.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by YoungDeveloper · Jun 02, 2016 at 11:06 AM

Mark all UI with layer UI and when raycasting specify which layers you want to hit using bit shifting. That will give you solution to raycast everything except ui or certain layers only. UI layer is already created for you in unity editor.

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 Eudaimonium · Jun 02, 2016 at 11:08 AM 0
Share

Yeah but he's not manually doing raycasts, he's literally just clicking the UI buttons with the mouse as far as I understood it. So the raycast should be handled automatically behind the scenes, and it does, though for some reason it gets blocked by world objects (on the opposite side of the canvas, to make it even weirder).

I don't believe you can access the raycast mechanics of UI clicking system, can you?

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

World Canvas and Locked Cursor 0 Answers

UI image with collider doesn't work OnMouseDown 1 Answer

Canvas problem with render mode : World Space 0 Answers

How to make World Space Canvas be on top of Overlay Canvas? 0 Answers

Issues with world space canvas for different resolutions. Any Workaround ? 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