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 ExCx · Mar 07, 2013 at 11:12 AM · guicollidermeshbuttonbox

Is Mesh Collider Optimal for GUI?

I'm using textureless (without a mesh renderer) simple planes for detecting touches on GUI buttons. They come with a box collider by default, but I'm changing them to mesh collider, as it sounds more performance-friendly. Am I doing a right thing? (ofc I'm checking the "is trigger" box, too)

Unity's own GUI engine is not fit for me btw.

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 Eric5h5 · Mar 07, 2013 at 09:26 PM

You should not use mesh colliders unless there's no other choice. All other colliders are much faster. In other words, don't change the box collider to a mesh collider.

Comment
Add comment · Show 5 · 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 ExCx · Mar 07, 2013 at 09:29 PM 0
Share

Hmm, can you be more precise (show some reference links, etc.)?

I expect a mesh collider to be mesh dependent. I mean, if my mesh is more complex, then the collider is too. Isn't it working that way, what am I missing here?

avatar image Eric5h5 · Mar 07, 2013 at 09:38 PM 0
Share

That's true, but the least-complex mesh collider is still more complex than a box collider. You can't make any assumptions about meshes, therefore optimization options are limited, whereas you can make a number of assumptions about a box collider (primarily: it's always a box!) therefore it can be optimized a lot more.

Also, you're always getting a bounding box with a mesh collider anyway (so tests can be done against that first before doing more complex mesh stuff if necessary), so you might as well do only the bounding box and dispense with the rest.

avatar image ExCx · Mar 08, 2013 at 08:31 AM 0
Share

Ok, so you're saying it's not possible a mesh collider to be more complex than a box one, even if my meshes are the simplest 2 triangle planes (made with this: http://wiki.unity3d.com/index.php?title=CreatePlane) which they all are.

So, I'm accepting this answer, thank you.

avatar image Eric5h5 · Mar 08, 2013 at 05:12 PM 0
Share

I'm saying the opposite of that actually. :) It's not possible for a mesh collider to be simpler than a box collider.

avatar image ExCx · Mar 09, 2013 at 01:03 PM 0
Share

Haha, sorry for my English. I meant exactly that. Let's just say "Box" is BETTER than "$$anonymous$$esh" in this situation.

avatar image
0

Answer by justin_iSO · Mar 07, 2013 at 07:01 PM

This is probably okay performance wise (assuming you don't go crazy and have a million buttons). However, if the screen resolution changes, you run a risk of your planes not being aligned with your GUI.

Comment
Add comment · Show 2 · 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 ExCx · Mar 07, 2013 at 08:10 PM 0
Share

The game I'm making is for iPad, so it will be in fixed resolution. Thanks for the warning anyway.

avatar image justin_iSO · Mar 07, 2013 at 08:15 PM 0
Share

Sounds good. I have used this method before and it worked fine for me.

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

12 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

Related Questions

Box colliders from procedural mesh 1 Answer

proper inventory system issue.. 1 Answer

[Particles] Restrict particles inside a Mesh 1 Answer

Primitive Collider slower then mesh collider 0 Answers

GUI.Button error 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