Search Unity

Concave Collider - Generate compound colliders with one click! [RELEASED]

Discussion in 'Assets and Asset Store' started by UGTools, Oct 10, 2012.

  1. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Thanks for the answer. Have the lot of GameObjects any impact to drawcalls? I have to give them all a procedual assigned collision event delegation script, whose send these events to the main collision method. Probably i have to make myself in blender simple shapes without faces, just for colliders, for the hull and turret. Then i can assigne a convex meshcollider...

    However, i bookmarked your asset, and im quite sure, if it comes to madness asset store event, i will buy it ;)
     
  2. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    No impact to drawcalls, maybe some impact on the physics but it all depends. If you don't create too many you won't notice anything.

    If you add it to your wishlist Unity has more chances to select it for an Madness Asset Store event :)
     
  3. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    kilik128 likes this.
  4. canaljuegos32

    canaljuegos32

    Joined:
    Jun 29, 2015
    Posts:
    63
    The chains still break at lower scales?.
     
  5. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi canaljuegos32,

    What do you mean exactly? The links? the rope? which rope type?
     
  6. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    Does this asset allow the creation of convex colliders out of the concave ones?

    I just read that you cant use concave colliders on rigidbodies
    but creating fitting convex colliders for each object is a hassle

    would this asset speed the process up?
     
  7. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes, that is exactly what this asset does :)

     
  8. Plutoman

    Plutoman

    Joined:
    May 24, 2013
    Posts:
    257
    Brilliant!

    This will save me weeks of time. Possibly months. I was iterating through assets and the single time-consuming point of setting up our prefabs for generation (procedurally placed) was setting up reasonable physics colliders.

    This has taken time per prefab from 20-30 minutes down to 30s-1min. Across hundreds of prefabs, that's a huge time gain.

    On a separate note, this brought to my attention a very... odd physics bug involving convex colliders. If you have a rigidbody with convex colliders, and you do a sweep test against a scaled mesh collider, it will fail and not hit the object. If the mesh collider is unscaled, it works fine, or if the rigidbody has a compound primitive collider with a scaled mesh collider.

    It's a somewhat odd problem, but if you ever get reports for sweep test issues, that could be a very likely reason.
     
    UGTools likes this.
  9. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hello Plutoman,

    I'm really happy it worked so well for you. I would love to have your review at the Asset Store, that would help me a lot :)
    Regarding the sweep tests, I will take a look at it and get to the Unity guys if necessary. Thanks for pointing it out!

     
  10. Plutoman

    Plutoman

    Joined:
    May 24, 2013
    Posts:
    257
    Left one, and the experience was easy enough that I picked up your LOD setup (conveniently posted just a week before I decided to check out mesh simplification options..!) and will test that over the next few days. Procedural content + underground = realtime shadows as a requirement, and shadows past a distance of 20-30 have been shooting my poly count up to 6-10mil. Time to cut that back.
     
  11. cej

    cej

    Joined:
    Sep 10, 2015
    Posts:
    2
    I am trying to use this asset to generate Colliders for clouds. When you enter a cloud a bunch of effects should be enabled and disabled when you exit.
    Problem I have is that it only generate a shell of thin colliders around the mesh, so I end up with a big cavity in the middle of the cloud.
    Is there a way to generate a collider that's solid all the way through?
     
  12. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi cej, do you have screenshots of the mesh? I would like to see how it looks like :)
     
  13. Slowin

    Slowin

    Joined:
    Mar 6, 2015
    Posts:
    62
    May I provide a mesh for hull generation that is different from the mesh being rendered (as it is possible with the Unity mesh collider)? Because this is exactly what I would need to help the algorithm as much as I can with an already optimized mesh.
     
    Last edited: Oct 30, 2015
  14. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Not directly but there is a simple workaround. You can use it on your simplified mesh and then just move the child nodes the tool has generated to the complex gameobject. That should do the trick.

    The "Add Hull Meshfilter" is an option I added to be able to render the hull(s) the tool has generated, but has no relation to what you wanted :)
     
  15. CharlesMax

    CharlesMax

    Joined:
    Aug 31, 2015
    Posts:
    1
    Hi
    I'm having this problem when you build the collider, can you help me?

    ConvexHullBuilder::CreateTrianglesFromPolygons: convex hull has a polygon with less than 3 vertices!
    UnityEngine.MeshCollider:set_convex(Boolean)
    ConcaveCollider:ComputeHulls(LogDelegate, ProgressDelegate) (at Assets/Ultimate Game Tools/ConcaveCollider/Scripts/ConcaveCollider.cs:345)
    ConcaveColliderEditor:OnInspectorGUI() (at Assets/Ultimate Game Tools/ConcaveCollider/Editor/ConcaveColliderEditor.cs:138)
    UnityEditor.DockArea:OnGUI()
     
  16. Caedicus

    Caedicus

    Joined:
    Nov 28, 2011
    Posts:
    23
    I am getting the same error as CharlesMax (convex hull has a polygon with less than 3 vertices). Any suggestion to get rid of this error would be appreciated. This tool is awesome, by the way.
     
  17. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Hi!

    Same problem here.... (ConvexHullBuilder::CreateTrianglesFromPolygons: convex hull has a polygon with less than 3 vertices!)

    Any advice?

    Thanks
     
  18. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Hi!
    Still getting the same errors. It seems to work fine anyway, but some help would be awesome..! :)

    Cheers!
     
  19. JacobK

    JacobK

    Joined:
    Jun 18, 2013
    Posts:
    20
    Plugin works great! Balked a bit about the price at first, but eh, it's worth it for the time it saves!

    Only got two minor issues with it:
    1: The generated meshes come in at 2x scale for some reason, and are way too big, so I have to scale them down afterwards? ( Might be because the parent object is at 0.5x scale)
    2: I've got a fair amount of meshes I need to generate concave meshes for, would be great if I could multiselect them all with the component on, hit compute and have it queue them all up & generate them all, instead of one at a time! (And pick a folder for where to save the meshes) The waiting is a bit of a pain and I'm lazy :D

    Awesome work!
     
  20. Marcirazzo

    Marcirazzo

    Joined:
    Nov 27, 2015
    Posts:
    47
    I have some question.
    Concave collider works well on mobile?
    The collider is divided into multiple parts? (As in a FPS I can adjust the damage depending on the affected part)
    As mesh collider, is it calculated on CPU and is it very expensive?
    As mesh collider, does the concave collider not take animation into it's collision shape?
     
    Last edited: Mar 25, 2016
  21. RichyK

    RichyK

    Joined:
    Feb 8, 2015
    Posts:
    57
    I'm trying to generate a collider for the Cu Cat mesh from the asset store but it just simply tells me "No hulls computed" when I press the Compute hull(s) button. Why is that? I've tried the fast, normal and legacy modes but still nothing. What do I need to do to generate a collision mesh for this?

    Richard
     
  22. RichyK

    RichyK

    Joined:
    Feb 8, 2015
    Posts:
    57
    It turned out to be that it uses a skinned mesh not a mesh filter.
     
    Lorrak likes this.
  23. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Thanks! :)

    Could you send me a sample .fbx / .obj? Scaling is considered in the computation so something's probably wrong there.

    Yes, I think I could do that. I'm currently preparing version 2.0 so I'll add that to the new version as well :)
     
  24. KeepTrying

    KeepTrying

    Joined:
    Feb 23, 2011
    Posts:
    119
    @UGTools Concave Collider is able to generate a 2D Collider from an Simple 3D Maze Mesh ?
     
  25. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    No, only 3D colliders sorry.
     
  26. KeepTrying

    KeepTrying

    Joined:
    Feb 23, 2011
    Posts:
    119
    Thank you Mr.
     
  27. HobieKenobi

    HobieKenobi

    Joined:
    Sep 12, 2014
    Posts:
    10
    Hello UGTools,
    I'm trying to get your fracturing program to use your concave collider but I can't seem to get it to work. Please outline the steps needed to get Ultimate fracture to use Concave Collider. There's an option in Fracturing but how to make it work.
    thanks.
     
  28. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi there,

    Do you have Concave Collider installed? Can you enable the checkbox?

     
  29. HobieKenobi

    HobieKenobi

    Joined:
    Sep 12, 2014
    Posts:
    10
    yes I have CC installed, no I can't check the box it just gives a pop up saying I need to buy CC.

    I've had UFD installed for a while now (great program BTW), and decided to see if CC would help with a few larger fractured objects so I got CC and installed it. But UFD doesn't seem to know it's there.

    Do I need to add CC to the pre fractured object?

    Can you outline the workflow please :).

    Thanks.
     
  30. Deleted User

    Deleted User

    Guest

    Hello UGTools,

    Is there a reason that this should not work with a "flat collider" like a plane? It's still a 3D collider, but the error "No Hulls Were Generated" happens.

    Thanks.
     
  31. HobieKenobi

    HobieKenobi

    Joined:
    Sep 12, 2014
    Posts:
    10
    Ok insert embarrassed face hear......I upgraded UFD to 1.7 and it works nicely....should have read to version notes, sorry.
    Thanks UGTools.
     
  32. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    It just should check for a .dll in your \plugins folder to know if you can enable the checkbox or not. Can you show me the folder structure and contents of \plugins? Which version of CC and F&D is it?

    No, you don't need to add anything manually. It just computes different colliders during the collider computation phase :)
     
  33. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes, it expects source objects to have volume :)
     
  34. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Ah, nice! If you need any more help just tell me. Hope it works OK.
     
  35. Deleted User

    Deleted User

    Guest

    Ok...but why? The points are in all in 3D space, they just happen to all be on the same plane.
     
  36. invadererik

    invadererik

    Joined:
    Oct 31, 2010
    Posts:
    148
    Looking forward to the tool not crashing Unity 5 editor randomly...

    also this error keeps on popping up:
    Gu::ConvexMesh::loadConvexHull: convex hull init failed! Try to use the PxConvexFlag::eINFLATE_CONVEX flag. (see PxToolkit::createConvexMeshSafe)
    UnityEngine.MeshCollider:set_convex(Boolean)
    ConcaveCollider:ComputeHulls(LogDelegate, ProgressDelegate) (at Assets/Ultimate Game Tools/ConcaveCollider/Scripts/ConcaveCollider.cs:345)
    ConcaveColliderEditor:OnInspectorGUI() (at Assets/Ultimate Game Tools/ConcaveCollider/Editor/ConcaveColliderEditor.cs:138)
    UnityEditor.DockArea:OnGUI()

    This is a very essential piece of my games pipeline, please fix these issues !

    * It would also be great if once I save a .asset, there was some easy way to load it into a fresh concave collider component.

    * would be awesome if I could select sub meshes or polygons on a mesh to run the algorithm on so that I wouldn't
    have to jump into dcc tool to split a mesh so I can select a sub mesh.
     
  37. barikinil

    barikinil

    Joined:
    Apr 15, 2015
    Posts:
    11
    Hello,
    My question could be very simple, but i cant solve.
    How can I edit hull component that created as convex mesh collider.
    CC compute hull, everything is ok but I dont like hollow space collider and I want to edit that one hull component created by CC. 3dsmax cant open this.
    Is this possible. ?
     
  38. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Collider creating whit this can be trigger at all? I use Trigger Enter action of PlayMaker but it can not recognize the collider created with Concave
     
  39. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    @ksam2 You need to target the root object (the one that has the Concave Collider component). That one should have the OnTrigger calls
     
  40. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi barikinil. Currently there is no way to edit colliders in Unity on a per vertex basis I'm afraid :(
     
  41. DanScallion

    DanScallion

    Joined:
    Jun 16, 2014
    Posts:
    4
    There is a bug, generated collider is too small. I know why it is like that thought. The model have scale 1/1/1 but it is a child of other object. That parent is scaled to 20/20/20. So the mesh shows at size of 20/20/20 and the collider at original size of the mesh.

    I have also question about pure performance for a static object that won't collide with anything other than player, will it give better performance than mesh collider both convex and non-convex?
     
    Last edited: Jun 4, 2016
  42. hungseparate

    hungseparate

    Joined:
    Aug 25, 2014
    Posts:
    10
    Hello UGtool, great tool btw (y)
    But i also got a problem when export ipa.
    It's show some thing like "couldn't find platform family in info.plist or ConvexDecompositionDll" !!!

    Do i need to config anything else for these file ?

    Thx :D
     
  43. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Thanks for the heads up!
    If you have a static object, use a standard mesh collider with convex unchecked. Use concave collider only for dynamic objects :)
     
  44. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi! thanks for your support :)
    Which version are you using? ConvexDecompositionDll should not be part of a build in iOS.
    Try renaming the Plugins folder for something like _Plugins_ before doing your build and restore the name after, does it still happen?
     
  45. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    420
    Hi, is it possible to use this to create a sphere collider that can have particles collide with the interior walls of the sphere?
     
  46. JamesSen_DS

    JamesSen_DS

    Joined:
    Jan 13, 2016
    Posts:
    12
    Great tool it's saving me and my art team a large amount of time and manual work I've just got a couple of issues which i'm guessing is most likely down to the meshes of the models which will need optimizing.

    I'm trying to generate colliders for a large number of meshes and in a number of circumstances i'm receiving the following errors:
    ConvexHullBuilder::CreateTrianglesFromPolygons: convex hull has a polygon with less than 3 vertices!
    Gu::ConvexMesh::loadConvexHull: convex hull init failed! Try to use the PxConvexFlag::eINFLATE_CONVEX flag. (see PxToolkit::createConvexMeshSafe)

    Here's a screenshot of the original mesh (Single mesh not a hierarchy) and the resulting hulls rendered.

    upload_2016-7-26_14-27-13.png

    Here's the settings:
    upload_2016-7-26_14-28-16.png

    This error also seems to be causing a memory leak inside the DLL as every time I hit compute my memory usage goes up more and more.
    upload_2016-7-26_14-29-22.png

    Is this simply just a case of having to split up the mesh into individual components and try again?

    J

    Edit: We've now split the mesh and done each mesh separately. The results are much better. There are some situations where the settings of the script have to be modified to give accurate results on almost identical meshes (mostly scaling) but all in all it improved the situation.

    One thing i have noticed however is in almost all circumstances the normal algorithm gives much better results than the fast, produces significantly less errors and doesn't seemingly hang as often but maybe this is just due to the mesh we are using.
     
    Last edited: Jul 28, 2016
  47. phoenixrising

    phoenixrising

    Joined:
    Aug 9, 2013
    Posts:
    57
    Is the ConvexDecompositionDll.bundle needed when making an xcode project?

    It is automatically being added to the xcode project. I tried to upload a beta build but apple rejected it for some weird error about an entitlement. I removed the reference from the xcode project and it built and apple accepted it.
     
  48. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Nice! Yes, usually fast gives good enough results and is way faster than normal, but depending on the object you may need to use normal.
    I'm currently testing another new method (the one Unreal Engine uses) called V-HACD which should give better results in 90% of the cases. Hopefully available soon :)
     
  49. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    No, you only need it if you compute concave colliders at runtime but I guess it's not the case.
     
  50. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    I have a terrain (it's a mesh) that was created by a tessellation map. I need to achieve collider for this. is there any advise? also I need all bumps (even tiny bumps) on terrain get collider surface.

    Is that even possible? please help. thanks.