Hello! Is it possible somehow to convert a complex collider in another type? I am using 2D toolkit, but it creates meshes and in 2D it results in edge colliders: the problem is that i cannot use them properly with some other features, so i am asking if it possible to convert the collider in another one, keeping same vertex. Thanks in advance, have a nice day! Kaem
Probably could make editor script for that, - Take edgecollider vertices - assign them to polygoncollider verts Or does it just work if you delete edgecollider, and add polygoncollider component ? (and you can multiselect many objects to do that for all)
Thanks for the suggestion! I tried to simply add polygon collider, but it is a complex mesh (made by 2D toolkit), so it simply add a polygon fitting the shape, but totally different from all vertices i need. You suggested an editor script, as i am a newbie could you point me what should i do and where to start scripting. I read something on the manual, so i suppose i should use public function SetPath(index: int, points: Vector2[]): void; but actually i don't know how and where to set it properly. Could you gently give me a bit more help? ^^
Sure, thanks. Here it is Exact collider is an edge one, built on the complex mesh derived by 2D toolkit. If i try to add a Polygon Collider 2D to the chunk, it is a simple pentagon without any consideration of vertices... Did you understand? ^^
I wrote a script to do this, here you go: https://github.com/HawkenKing/Edge-collider2D-to-Polygon-collider-2D Probably doesn't work with cutouts, but feel free to report issues on github