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 bpears · Dec 20, 2012 at 02:03 AM · mesh colliderbox colliderroad

Which is most optimized collider for road?

I have a lot of road. Should I have the roads as one mesh, or multiple (If using mesh collider)? The roads are all flat, so is there any advantage in using box colliders over mesh colliders?

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 JaydenM1997111 · Dec 20, 2012 at 07:16 PM 0
Share

I think a box collider would work better to your advantage.

1 Reply

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

Answer by sparkzbarca · Dec 20, 2012 at 07:31 PM

box collider is MUCH MUCH faster.

It has to do with built in shortcut methods of detecting collisions.

For example an object which is greater than half the width of a square from the center of the square is clearly not colliding with it.

2 boxes could quickly be compared for collision this way against eachother.

Meshes dont allow you to make assumptions like a box that allows you to easily define the shape completely based on the center point. Circles/spheres are the next best shape and they are equally defined by there radius.

Now with circles for example once you get close you have to do some harder math to figure out the exact point of collision. But You can instantly discard many possible collisions through fast distance checks.

(meshes do this to for some extent. Thats what bounding boxes are for, but bounding boxes are in fact exactly a box, so box is fastest.

Bounding boxes are the smallest box possible which emcompasses all vertices of a mesh. There used as a shortcut way to test as well.

Still boxes are way faster, followed by spheres, then cylinder/capsule, then the mesh.

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 bpears · Dec 20, 2012 at 07:40 PM 0
Share

thanks, very helpful! Would it be better to use one collider per road chunk, or just one giant collider? And should I leave the road models as chunks or make them as one? Sorry so many questions..

avatar image edmundo096 · Aug 23, 2013 at 05:31 AM 0
Share

About the other questions, check this similar question (that has not been resolved yec correctly).. http://answers.unity3d.com/questions/374007/large-flat-surface-use-multiple-or-one-box-collide.html

I$$anonymous$$O, One Giant collider would be best, as only one GameObject is needed for the collider, not one for each chunk.

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

Multiple Cars not working 1 Answer

For flat mesh, is there a performance difference between box vs mesh colliders? 1 Answer

Mesh Collider strange behavior with box collider. 0 Answers

In WebGL build, Rigidbody only collides with Mesh Collider if it has previously collided with Box Collider 4 Answers

What is the best collider to use for a simple (1 quad) plane? 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