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 chelnok · Nov 14, 2012 at 07:48 PM · collidermeshconvexprimitive

MeshCollider vs. anyOtherCollider

What might be good combination for situation like:

SpaceShip, thePlayer (1300 poly, meshCollider,convex) SpaceShip, theEnemy (1300 poly, meshCollider,convex) Surroundings, total 40-100 per level (each 200 - 2000 poly, meshCollider) Bullet (capsuleCollider) Flamer (particleCollider)

Documentation says: "The typical solution is to use primitive Colliders for any objects that move, and Mesh Colliders for static background objects."

And: "Convex Mesh Colliders are limited to 255 triangles."

So, my ship got 1300 triangles, but i do not get any error messages for using convex option. Does 255 tris actually mean calculated convex tris, not original amount of triangles (1300)?

Main question: Not sure what to ask :) but i guess.. Should i replace convex meshCollider from player and enemyship with multiple primitive Colliders? If so, how many primitive colliders is ok to use, 10, 100, 1000?

This setup works pretty well at my computer, but could this cause some problems with other computers?

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

1 Reply

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

Answer by Eric5h5 · Nov 14, 2012 at 09:03 PM

but i do not get any error messages for using convex option

Maybe you missed it; if you attempt to click the convex box for a mesh collider with more than 255 triangles, you get an error in the console that says "The hull has more than 255 polygons. This is invalid."

Should i replace convex meshCollider from player and enemyship with multiple primitive Colliders?

Yes, if you can get a reasonable collision shape with as few primitive colliders as possible. It wouldn't make any sense to use 1000; in that case it would be slower than a convex mesh collider. Note that you don't need to use the same mesh for collision that you use for display.

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 chelnok · Nov 14, 2012 at 10:08 PM 0
Share

Thanks. Now when i look the ship in unity with wireframe view, with and without convex, i am actually pretty sure i can do even better with primitivs than meshCol with convex option. But i cant get no error msg to consol when clicking convex on/off, playmode, build.. I checked also player and editor logs. I also made empty scene with only camera and the ship$$anonymous$$esh. Stat window: Tris:456. $$anonymous$$y script: 1368 ( print( GetComponent($$anonymous$$eshFilter).mesh.triangles.Length ) ; ) And believe or not, i tried to count triangles in unity editor wireframe view :) and now i am sure there is more than 255, no way 1368, but perhaps 456 is pretty close. Any toughts of that?

avatar image chelnok · Nov 14, 2012 at 10:14 PM 0
Share

I went to smoke cigaret, and i understood 456x3 = 1368 :) No idea what, why and.. Edit: "The array is a list of triangles that contains indices into the vertex array. The size of the triangle array must always be a multiple of 3." I guess that explains it. Still no idea why..

avatar image cassius · Nov 14, 2012 at 10:19 PM 0
Share

Is it possible for you to also make a very low-poly version of your player and enemy ships and then use that mesh for a mesh collider?

avatar image chelnok · Nov 14, 2012 at 10:29 PM 0
Share

I guess that is one way to go. I need to ask graphdesigner to do that, unless there is a way to open fbx file in blender? I know it is exported from Blender, but still, i couldnt open it.

avatar image cassius · Nov 14, 2012 at 10:45 PM 0
Share

Blender can't open .fbx files.

Primitive colliders are usually the best to go with as long as you're not using too many and you're able to somewhat match the shape of the mesh.

But if you need the colliders to closely match the shape of the ships, a reduced poly model with mesh collider may be an option.

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

11 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

Related Questions

Problem with convex Mesh Colliders 0 Answers

Mesh Collider HELP - 1 Answer

Too many colliders? 0 Answers

A question about collisions. 1 Answer

Can I catch "Gu::ConvexMesh::loadConvexHull: convex hull init failed!" error? 2 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