-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to export each polygon collider as a separate collider gameobject. #18
Comments
Tivec, I think what you're asking for is to replace one PolygonCollider2D I think your approach is the right one, provided you make it a custom That way when you export your Tiled maps you will have automatically You can read about custom import scripts here: Make sure that such custom scripts have the CustomTiledImporter attribute Best, On Mon, Sep 14, 2015 at 8:41 AM, Tivec notifications@github.com wrote:
|
I'm sorry for taking so long to respond. I solved the issue by writing a custom importer that splits the colliders into new seperate ones, and I think that it works fairly well. Thanks again for a great tool that helps production in Unity lots :) |
Glad it worked. Thanks, Tivec. On Wed, Sep 23, 2015 at 2:20 PM, Tivec notifications@github.com wrote:
|
@tivec Are you willing to share that with us? |
Of course! My script is fairly simple and should be quite easy to understand. I should also set a disclaimer: I am barely adept with C#, and there may be poorly written code in the snippet. You have been warned! https://gist.github.com/tivec/9216ed5c30d60c4c84d8 You would have to customize it if you want to handle anything except the layer "Walls", but the idea is the same :) |
Hello!
I have this map being exported from Tiled to Unity via this tool: http://i.imgur.com/3AL4UPP.png
When this prefab is loaded, the collider that was generated will be one of two paths under the same game object. What I would like to see is an option to export each of these two to separate polygons. This would help me out when working with something such as PolyNav2D.
Right now I solve this with a script attached to the collider that splits it into child objects, but that's probably not the best way of doing it. Here's the script I use: http://pastebin.com/0Bdv97jB
It splits each path in the polygon and makes a new sub object to the collider gameobject. If this could be done as an option from Tiled2Unity, that'd make it a lot nicer to work with :)
Thanks for a great tool, and keep up the great work!
The text was updated successfully, but these errors were encountered: