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 Bertrand · Dec 11, 2010 at 05:56 AM · proceduralmeshcollidercollisionsphysicmaterial

Strange Behavior of Mesh Collider for Dynamic Mesh

Hi,

I am getting crazy with a mesh collider that does not want to work.

I believe, I am missing an update function call but I don't see where.

What makes me suspect this, and, what is really strange is that if I change the physical material in the inspector at run time then the mesh collider detects the collisions correctly.

Basically, the mesh is created by a script during the update function of the component.

The script is very similar to the procedural mesh samples provided by unity in its sample collection.

  1. I tried different methods of initialization of the mesh collider and of the physical material but it seems that does not change anything. The physical material loaded is "wood".
  2. I am using sharedMesh , and sharedMaterial all along the way. I also did try to reaffect them as necessary...
  3. The loaded material is present in the inspector at runtime.
  4. I tried attaching a rigidbody in kinematic mode it did not change the result.
  5. I tried calling various update functions such as RecalculateBounds() or WakeUp(), no effect...

Does anyone had similar experience ? or have one idea of the the reason that would explain why chaging the material in inspector starts make working the mesh collider, and what kind of call I may be missing to make work the mesh collider.

Thanks for any help...

Bertrand

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

Answer by Bertrand · Dec 11, 2010 at 10:40 AM

Well, I believe I have finally found out what was going on... I had left some degenerated triangles(all nodes to the same vertex) in my mesh, these one were not visible and had not effects, except that removing them, re-enable the collision with the mesh...

It is likely that these degenerated triangles in the mesh were generating a "division by zero" exception in the meshcollider code... and that for this reason the mesh collider code was returning without reporting collisions.

If this is the correct explanation, I believe a warning should be issued to inform the developper of that collisions have not been handled due to some invalid triangle in the mesh.

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
avatar image
0

Answer by shinriyo_twitter · Oct 13, 2011 at 07:22 AM

I did like this [CODE] MeshCollider meshCollider = GameObject.Find("YOUR TARGET GAME OBJECT").GetComponent(); meshCollider.convex = true; [/CODE]

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

1 Person is following this question.

avatar image

Related Questions

Prevent Fallthrough with Procedural Mesh and Collider 0 Answers

Turn Off Mesh.Bake Scaled Mesh PhysX CollisionData ? 0 Answers

AAPT Failed! 0 custom asset files in raw for Procedural Examples Paint Vertices to Android 2 Answers

Collision with Plane fails 0 Answers

MeshCollider is not getting updated when adding vertex to mesh 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