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
0
Question by Piflik · Sep 21, 2011 at 05:30 PM · meshcolliders

Problem with non convex mesh colliders

I have a little problem trying to use a mesh collider. If I don't activate the 'Convex' option, it doesn't register a collision. But I need it to be precisely the shape I have created, not a convex hull. Can I somehow increase the number of substeps in the physics simulation or do anything else to make it work?

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

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by gribbly · Sep 21, 2011 at 05:35 PM

You can increase the physics solver iteration count in Edit -> Project Settings -> Physics. Default is 6 I believe.

You can also experiment with the "Interpolate" and "Collision Detection" properties on any rigid bodies that are colliding with your mesh collider. Try Continuous instead of Discrete collision, especially if anything is moving quickly.

Does any of that help?

Comment
Add comment · Show 4 · 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 Piflik · Sep 21, 2011 at 05:44 PM 0
Share

The collider in question is not moving at all, it is created and destroyed 15 fixed timesteps later. It is also the only rigid body involved.

Sadly none of the above changed anything. I think I'll have to create a convex version of the hitbox that still covers all of what I need withoug cutting into areas that should not collide...

Thanks anyway.

avatar image syclamoth · Sep 22, 2011 at 12:02 AM 0
Share

How are you using it? You could try making a compound collider out of several primitives. Also, I was given to believe that collision messages only got sent by rigidbodies- how is it the only rigidbody in your scene if it isn't moving? If the other objects do not use rigidbody physics, they should not be colliding with anything, let alone a mesh collider.

avatar image Piflik · Sep 22, 2011 at 08:32 AM 0
Share

For a collision, only one of the two objects has to be a rigid body.

The collider is made of three joined extruded hexagons and I use it to deter$$anonymous$$e if a melee attack hits (it can hit the tile in front of the player and the two adjacent to that). The player swings his sword, a rigid body with that collider is created and if an enemy is sitting on one of the tiles, he registers a hit and is damaged accordingly. It works with standard colliders and with mesh colliders set to convex, but not with concave colliders.

But since the enemies also have a one-tile hexagonal collider, I don't have to encompass a tile completely to make the attack hit, so I rebuilt the collider for the sword-swing with a convex mesh.

The problem with the detailed hexagonal collider was, that it cut into tiles that should not be hit. The new, convex collider does not and up to now it works perfectly.

avatar image chad47 · Jan 06, 2016 at 04:10 AM 0
Share

I'm not OP but this helped me thx

avatar image
0

Answer by UGTools · Oct 30, 2012 at 04:57 PM

It is a common problem when two mesh colliders hit. One of them needs to be convex so if it is your weapon then sometimes you will register very imprecise collisions because of the convex limitation. The usual workaround is to build a compound collider with multiple primitives (usually boxes or spheres) to approximate the object in question. In many cases it is simple because with 2 or 3 it will work, but many other times you need a more complex setup and doing this manually is a lot of work.

We've developed a solution to do this automatically. One example we show is precisely an Axe, but in that case what I'd recommend is to use two or three box colliders since you don't need such an extreme precision for that.

Anyway, here's a video showcasing the component: YouTube

It is available at the Asset Store: link

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 stanzy · Feb 22, 2017 at 10:06 AM

Use the NonConvexMeshCollider script to solve your problem:

http://www.productivity-boost.com/DownloadNonConvexMeshCollider.html

I implemented that by myself because I had the same problem.

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 wolga2 · Mar 09, 2017 at 04:02 PM

Turn on 'Queries Hit Backfaces' in the PhysicsManager (Edit --> Project Settings --> Physics). At least that helped me :)

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

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Shuriken world collision not working with mesh collider 1 Answer

Assign/add gameobject to LOD via script 1 Answer

C# Array of OtherArray's Meshes 1 Answer

Problems with Transform.Find and GameObject.find 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