Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[Released] Easy Collider Editor

Discussion in 'Assets and Asset Store' started by pmurph03, Jul 30, 2016.

  1. pmurph03

    pmurph03

    Joined:
    Mar 17, 2014
    Posts:
    51
    Easy Collider Editor is available on the asset store at u3d.as/xxw

    Please contact me at pmurph.software@gmail.com if you require any support or any further information!

    This asset went through a major overhaul in 2020 around the time when COVID began because I had lots of time to spare. So there have been a lot of changes since this post was originally made, and a ton of new features added during, and after the overhaul.

    Lots of the new features were added by user request or based on user feedback. So if you've been using my asset and have an idea that would make my asset easier/better for you, please let me know! Thank you as always to the amazing users of my asset who suggest additional features and improvements, you make the asset better for everyone!

    Other than some minor behind the scenes improvements in some areas, I'm actually running a bit low on features to add to my asset. If you're thinking "there's no way he'll think about adding this just because I asked", I'll just say that I genuinely love hearing any ideas, and several features came directly from customer suggestions in the past. Even if you don't have a solid idea, but have a thought like "I wish there was an easier way to do X", it might point me in a great direction.

    Features I'm currently working on over time:

    I'm currently investigating improvements to vertex selection to provide a more consistent vertex selection experience with options for backface culling.

    I've also worked on implementing run-time VHACD calculations that is done asynchronously, and can be done on multiple different meshes at once. It mostly works, but unfortunately has some issues in my testing that make it very much not production ready. I hope to return to working on this feature eventually. If you really need this feature added, please let me know.


    Heres a quick video of some of the features in action:


    Easy Collider Editor is available on the asset store at u3d.as/xxw

    The store description for my asset is as follows:

    Easy Collider Editor is designed to make creating and positioning box, sphere, capsule, cylinder, and convex mesh colliders as easy as possible. This tool lets you quickly and easily add multiple colliders on gameobjects using simple and easy to use vertex selection tools. No more painfully adding, moving, and resizing colliders.

    A helpful preview is drawn as you select points to make collider creation even easier. Shortcut keys let you swap between previews and create a collider from the current preview. Other options include letting you to decide how the created colliders get attached, and the ability to create multiple colliders around a pivot point.

    Another feature in Easy Collider Editor is convex hull generation using VHACD in both Windows and Mac. This lets you automatically generate multiple convex mesh colliders on any mesh with a simple click of a button. Using multiple convex mesh colliders lets you better represent the shape of the mesh while still allowing physics and rigidbodies to work correctly. All VHACD parameters are exposed and easily adjustable, and a preview of the result is calculated and displayed as you work. Additional options for VHACD allow you to use only selected vertices, process meshes individually, and convert the output automatically to boxes, spheres or capsules.

    Easy Collider Editor can also automatically generate box, capsule, sphere, or convex mesh colliders along a skinned mesh's bones. Parameters for this let you exclude vertices by weight, automatically realign colliders with the bones, exclude specific bones, or stop generation after a specific bone.

    The new merge collider tools can be particularly useful after creating lots of convex mesh colliders using VHACD. Select colliders of any type and merge them into a single collider of any type. Shortcut keys and previews work for merging colliders as well.

    Easy Collider Editor uses VHACD under BSD-3-Clause, see ThirdPartyNotices.txt in package for details.



    Additonally,
    I don't check this thread as regularly as my e-mail, even though I have this thread watched, it is easier for me to respond, and faster to get a response if you contact me directly through e-mail. So if you have any issues or questions please be sure to contact me directly at pmurph.software@gmail.com
     
    Last edited: Sep 17, 2021
    theANMATOR2b likes this.
  2. pmurph03

    pmurph03

    Joined:
    Mar 17, 2014
    Posts:
    51
    I have been very busy as of late (due to finishing up my engineering degree) and have not had time to implement additional features in a release build.

    I have been able to keep on top of fixing any critical bugs I am alerted too, as well as provide support.

    After these next two weeks I should have significantly more time to work on adding additional features to this asset.
     
  3. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    Can this tool create box colliders on a plane? I'm looking for something to speed up the process of adding primitive colliders to Probuilder created level design meshes- many of the walls are plane's- it looks like this tool needs depth as well to create boxes?
     
  4. pmurph03

    pmurph03

    Joined:
    Mar 17, 2014
    Posts:
    51
    I just tried it with the default plane in Unity and it does create a box collider around the plane, it does have a depth of 0 on the box collider when created. Testing it when a sphere with a rigidbody attached they do collide with each other.

    Hope this helps,
    Patrick.
     
    imaginationrabbit likes this.
  5. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    That definitely helps! Just purchased it- would be great if we could set a min box collider depth- that would be a huge timesaver in the situation I'm going to use it for- I'll have a look at the code myself as well- thanks!
     
  6. mikko_to

    mikko_to

    Joined:
    Oct 14, 2013
    Posts:
    21
    With this tool, is it possible to create similar colliders to some object as convex mesh collider, but you can identify different collider faces? My aim is to have a quite simple collider around a car object, but I could identify whether the collision occured to roof, front, side etc.

    I think this is achievable in Unity now by creating different colliders to each side, but having a convex mesh collider able to identify different faces would smooth up the work quite nicely.
     
  7. pmurph03

    pmurph03

    Joined:
    Mar 17, 2014
    Posts:
    51
    You're welcome, glad you enjoy it. I'm currently in the hospital right now and will probably be for another 2 weeks or so, afterwards I will look into adding a min box collider depth option that can be enabled in the settings.

    It certainly allows for simple colliders to form more complex colliders with more accuracy than entering the values themselves through the editor.

    It does not allow for identification of individual faces of a convex mesh collider. You could however use seperate/individual plane colliders for the roof, front, side, etc and allow the collisions to be identified that way.
     
  8. Jick87

    Jick87

    Joined:
    Oct 21, 2015
    Posts:
    124
    @pmurph03 I wanted to report an issue related to the rotated colliders...

    It seems the new gameobjects that are created to house the rotated colliders are offset from the parent position. Like, they are not at 0,0,0. But yet the "center" of the colliders is also offset. It seems like one or the other should be 0,0,0. The calculated offset also doesn't seem to make sense to me.

    For example, I created a rotated collider that is just a object that is rotated around its own center. However the origin of the created rotated collider object is off to the side somewhere, rather than at 0,0,0 as I'd expect.

    I'm attaching a crude illustration to try to explain it a bit better.

    illustration.png

    Hope I was able to get the problem across. :p

    Thanks for the great asset. Is saving me a lot of time. :)
     
  9. Jick87

    Jick87

    Joined:
    Oct 21, 2015
    Posts:
    124
    I just discovered that it doesn't seem to be an issue if the object you are creating a rotated collider for is at scene 0,0,0. It seems it is only an issue if the object is somewhere else in the scene which is not exactly 0,0,0.
     
  10. Jick87

    Jick87

    Joined:
    Oct 21, 2015
    Posts:
    124
    I noticed another issue...

    The displayed generated box colliders are not the proper size if the object you are working with has a scale of anything other than 1,1,1. However I figured out a solution for this problem...

    It can be fixed by changing line 234 of ColliderEdit.cs to this:

    Code (CSharp):
    1. tempVertList.Add( Vector3.Scale( transform.InverseTransformPoint( vector ), transform.localScale ) );

    And also change lines 529 and 530 to this:

    Code (CSharp):
    1. box.size = new Vector3(tempBox.size.x / transform.localScale.x, tempBox.size.y / transform.localScale.y, tempBox.size.z / transform.localScale.z);
    2. box.center = new Vector3(tempBox.center.x / transform.localScale.x, tempBox.center.y / transform.localScale.y, tempBox.center.z / transform.localScale.z);

    At first I thought it was the final product that was incorrect, but it turns out its only an issue with the interim box colliders shown while still editing. When you apply the colliders things seem to be correct in the original version. These changes make it look correct in both places though.

    This is just one of the issues that are really bugging me, but this one I was able to figure out how to fix. I decided to share it here in case it is useful to anyone else. These changes have not been extensively tested, but they work for me™...
     
  11. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
    Hey there.

    Does your tool add the colliders to children or to the same object?

    For my game I need to have all colliders on the same GO.
     
  12. Jick87

    Jick87

    Joined:
    Oct 21, 2015
    Posts:
    124
    @N00MKRAD Yes, it adds all colliders to the same object. Only when using rotated colliders does it add them to children, for obvious reasons.

    Disclaimer: I'm not the creator of the asset, but I figured I would answer since I've been using it and know how it works...
     
    N00MKRAD likes this.
  13. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
    Thanks a lot.
     
  14. pmurph03

    pmurph03

    Joined:
    Mar 17, 2014
    Posts:
    51
    Hey all, thanks for the info about problems you've discovered. I've actually been in the process of rewriting a lot of this asset to make it more easily updateable and configurable for people.

    I'm current on holiday for thanksgiving, but I'll work on adding fixes to the bugs you have discovered. The rotated collider issue likely came about between changes of removing the forced movement the object being edited to the origin, and the implementation of rotated colliders. Although as long as the generated collider ends up where it is supposed to be it shouldn't present any issues physics wise,only a visual issue with not having the rotated collider holder at 0,0,0.

    I am currently working on rewriting the code to make it more understandable, adding a selection on which gameobject you want to add the collider to (base object or selected, except in rotated colliders where a new gameobject will still be needed to hold it) as well as working on adding selection of verts across multiple meshes. Also working on rotated capsule collider creation as well.

    Most of the features have come through people submitting requests through email at pmurph.software@gmail.com but if you have any ideas for possible things to add to improve the asset I would love to hear them so I can try to implement them in the update/overhaul I am working on.
     
    Jick87 likes this.
  15. darbotron

    darbotron

    Joined:
    Aug 9, 2010
    Posts:
    351
    Hi @pmurph03

    I bought your asset today and have had fix a bunch of issues that happened when I tried to use it with Unity 2017.x

    I also put all my asset store packages in a folder within my project called "assets/3rdParty" which obvioulsy broke for this because you have hard-coded paths in there for the asset.

    Happy to share the fixes if you like (for the version that's on the asset store obvs.)

    I've also fixed your code for doing the rotated boxes to work in a way that is (IMO) way more predictable and uses much simpler maths (approx 1/3 the number of lines of code) - it does place a slightly tighter constraint on the way in which you select the vertices but the net effect is you get the exact collision box you select :)

    Again, happy to share the code / maths if you want :)

    Even with the fixes I think I've saved myself a good few days WRT writing it from scratch & way more days editing collision volumes the standard way.

    Cheers,

    Alex
     
    Jick87 likes this.
  16. halecc

    halecc

    Joined:
    Dec 17, 2016
    Posts:
    33
    Great product, was wondering if you are going to add the ability to do vertex select but for children instead of one single object. This would greatly decrease the amount of colliders i need.
     
  17. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
    There's an obsolete API warning when importing the package but it was recently updated, I went ahead and updated them but I'm not sure if it needs to be fixed by the developer?

    Also, is it possible to grow a collider generated using VHACD? I'd like to grow the size slightly larger than the mesh it's based on, is this possible?
     
    Last edited: Jan 8, 2021
  18. perrygamesstudio

    perrygamesstudio

    Joined:
    Jun 21, 2018
    Posts:
    23
    A few questions:
    1. Does this work on Unity 2021?
    2. Is there a setting to create basically a voxelized version of the mesh as unity box colliders with a density setting? As a compound collider or does it separate the colliders?
     
  19. pmurph03

    pmurph03

    Joined:
    Mar 17, 2014
    Posts:
    51
    Hey,

    1. It certainly does! It works from 2017 up to 2021. I've also previously done a 5.6.3 version for a user as well. It should mostly still work in earlier versions, I just don't regularly test in versions earlier than 2017, so they aren't officially supported on the asset store page. If any new version comes out and any bugs are discovered, just let me know and I'll fix them ASAP.

    2. There's no direct option to create a voxelized mesh. The best option for this right now is being able to automatically take the calculated mesh colliders from VHACD and turn them all into box colliders. Unfortunately this likely won't work as well (in some situations) as a direct to boxes voxel solution. I'll definitely add this to my list of suggested features though and look into adding it. So thank you for the suggestion!

    There are also multiple different collider attachment methods available: all one object like a compound collider, all on a single child object, or individually on child objects.

    If you have any other questions, feel free to send me an e-mail as well.
     
    Last edited: Aug 17, 2021
  20. mcguinnessdr

    mcguinnessdr

    Joined:
    Sep 20, 2014
    Posts:
    26
    It looks like the latest version, 6.7.2, is broken. Getting
    Assets\Plugins\EasyColliderEditor\Scripts\EasyColliderCreator.cs(1756,13): error CS0103: The name 'ECEPreferences' does not exist in the current context
    when trying to build. It looks like ECEPreferences is preprocessor defined for UNITY_EDITOR, but the callsite in `CreateGameObjectOrientation` is not.
     
  21. pmurph03

    pmurph03

    Joined:
    Mar 17, 2014
    Posts:
    51
    Hey, thanks for letting me know, I'll fix this right now.

    Update with the fix should be available now! Thanks again for letting me know about it.
     
    Last edited: Jan 17, 2022
  22. mcguinnessdr

    mcguinnessdr

    Joined:
    Sep 20, 2014
    Posts:
    26
    Wow, that was fast, thanks!

    Not a problem, but when I was looking for the error I noticed something weird on line 1322 of EasyColliderCreator:

    Code (CSharp):
    1. #if (UNITY_EDITOR)
    2.       EasyColliderQuickHull qh = EasyColliderQuickHull.CalculateHull(localVerts);
    3. #else
    4.       EasyColliderQuickHull qh = EasyColliderQuickHull.CalculateHull(localVerts);
    5. #endif
    Looks like the same line of code is being replaced?
     
  23. pmurph03

    pmurph03

    Joined:
    Mar 17, 2014
    Posts:
    51
    Thanks for pointing that out! Looks like it's a holdover from when I had different methods for editor/runtime quickhull usage that I changed to the same method but didn't cleanup properly afterwards. I'll fix that right now and it will be included in the next update.