Collider Generator
Client-Side SecureDraw polygon colliders on sprites and export to Unity/Godot. Essential for 2D game devs.
Export
Left Click: Add / Drag Point
Alt + Click: Remove Point
Wheel: Zoom
Is this tool broken?
Let us know if you found a bug or have a feature request.
The Ultimate 2D Collider Generator for Game Devs
Physics are the backbone of any 2D game, but creating accurate hitboxes is often a painful bottleneck. Default physics shapes like BoxCollider2D or CircleCollider2D are rarely precise enough for complex sprites like characters, weapons, or terrain.
The RootUtils Polygon Collider Generator solves this. It is a browser-based tool that lets you upload any sprite, visually draw a custom polygon mesh over it, and instantly generate the code snippet for Unity, Godot, or any custom engine using JSON.
Precision Hitboxes
In platformers or fighting games, a "loose" hitbox feels unfair to the player. If a bullet hits the empty air near a character but still registers damage, it breaks immersion.
By manually placing vertices with our tool, you create a tight-fitting mesh that strictly follows the alpha channel of your sprite. This ensures that collisions only register when pixels actually overlap.
Performance vs. Mesh Colliders
A common mistake is using a generic "Mesh Collider" which is computationally expensive.
A Polygon Collider is much faster. However, you should optimize your vertex count. A shape with 10 points is infinitely faster than one with 100 points. Use our zoom feature to place points strategically at corners rather than tracing every single curve pixel-by-pixel.
How to use the generated code
Unity (C#)
We generate a Vector2[] array formatted for C#. Copy the output and paste it into yourStart() or Awake() method. Ensure your GameObject has aPolygonCollider2D component attached.
Godot Engine (GDScript)
Godot uses PoolVector2Array. Our tool automatically formats the coordinates for GDScript. Simply get your CollisionPolygon2D node and assign the polygon property.
Physics Pro Tip: Convex vs. Concave
Physics engines (like Box2D used in Unity) love Convex shapes (shapes with no dents inwards). Concave shapes (like a crescent moon or the letter "C") are much harder to process physically. If your sprite is complex, consider using this tool to generate multiple smaller convex polygonsand assigning them to child objects, rather than one giant concave polygon.
You might also like
Split sprite sheets into individual images. Download as ZIP. Support for padding and offsets.
Auto-generate C# (Unity) and GDScript (Godot) classes with smart type inference. Save time on.
Free online Keyboard Test. Check for ghosting, key rollover, and broken keys on your mechanical or laptop keyboard. Instant visual feedback.