Efficiently Tweakable Mesh- or PolygonColliders
2D ColliderGen
Unity Extension
An extension for the Unity Engine
Available on the
Features
- Animated Colliders for Unity Sprite Animations
- No additional performance cost at runtime
- Simple parameters for optimal results - specify the vertex count you want
- Adjustible top/bottom/left/right Borders.
- Multi-object editing support
- Supports infinite holes and islands within a single image
- Colliders can be forced convex for MeshCollider Rigidbody collisions
- RuntimeAlphaMeshCollider script for on-the-fly generation
Compatibility
- Supports UGUI RawImages and Canvas Images
- Supports Unity Sprites and Raw Images
- Supports PolygonCollider2D, EdgeCollider2D and MeshCollider
- Supports all versions of Unity 2022 - 2017, 5.x, 4.x, 3.x
- Integrates with SmoothMoves, 2D Toolkit and Orthello (Free, Elements and Pro)
- Supports SmoothMoves BoneAnimation characters
- Supports OTTilesSprite and OTTileMap
Support
Documentation and Video Tutorials
Visit the support page and Unity forum thread below for more info.
Frequently Asked Questions
FAQ
Does 2D ColliderGen have any impact on the game's framerate?
No - it does nothing but add a MeshCollider or PolygonCollider2D.
Be sure to use the outline vertex countparameter of the AlphaMeshCollider to optimize the vertex count according to your shape - the fewer vertices, the better.
Can I use 2D ColliderGen to update colliders during runtime?
Yes - 2D ColliderGen supports precomputing colliders for Unity Sprite Animations which are switched active accordingly. If you can't precompute them, please visit the Runtime Collider Generation documentation page for details.
I just updated, where did the 2D ColliderGen menu go?
It's now under Component - 2D ColliderGen.
Does 2D ColliderGen work with other 2D frameworks?
Yes - just attach an AlphaMeshCollider to your object.
Then by default, the main texture of the object is used. If your GameObject has no texture attached, or in case of a texture atlas, you may need to set the Advanced Settings - Custom Texture parameter to provide the desired texture. Please visit this documentation page for further info.
There are no front- and back-caps on the MeshCollider, but I need them - what can I do?
a) Switch the AlphaMeshCollider output collider type to PolygonCollider2D.
b) Enable "force convex" at the AlphaMeshCollider and tick "convex" at the MeshCollider component, then the front and back caps are added automatically.
We are sorry to say that we don't offer a solution for concave MeshCollider caps.