- Home /
Unity 5 Polygon Collider Add Vertices
Not sure if it's a bug, or something has changed in Unity 5, but I can't seem to edit the vertices, other than moving the given ones, and deleting them, I can't add vertices at all. I tried holding shift, there's not sign of it adding a vertices at all.
Forgive me if I didn't google enough, just in case there's already a solution somewhere.
Normally, adding vertices should happend automatically when you click on a line bnetween two vertices.
This is nearly what the manual states as well, but for myself, and apparently for donaldleowjj, it does not. This is the very reason being unable do this is problematic and noteworthy. I do not get the segment handles I have seen in videos of what appear to be unity 5, and at any rate can not create new vertices by clicking or dragging on any part of the collider in edit mode, with or without shift or any other modifier key I tried. Since I sometimes, under not yet apparent circumstances don't get vertex handles at all, even on corners or ends I'm figuring this is a bug. I'm going to continue playing around and see if I can figure out how to consistently reproduce the latter issue but the former is so far constant.
I'm facing similar issues in unity 5.1.0f3 Personal on windows 7 64bit. In my case I can get no vertex handles at all, so I can not edit vertices or create/delete them. This seems to be the case for all Collider2d types. I'm still looking but I'm at a loss so far for solutions short of falling back to an older unity build. Is it possible this functionality is simply disabled in the personal edition?
[edit: I have handles now, some of the time. The only things I did between then and now was to save the project, build and run - though I had also done that previously while looking for solutions - and to view the editor log to look for potential problems. Now it comes and goes such that selecting 'Edit Collider' sometimes works and sometimes does not and I have not deter$$anonymous$$ed replication criteria yet. $$anonymous$$andelbug, anyone?] I still can not add vertices by shift dragging as the manual suggests. I'm trying to use polygon and edge colliders in my project particularly.
Were you ever able to figure out what was going on with this?
Answer by persijn · Oct 17, 2016 at 08:41 PM
Polygon collider 2D Workaround
Now i don't have a solution to getting the shift+click to work but,
If you go to the Polygon Collider 2D inside the inspector:
Go to points handle
Then Paths
Then Element 0 (or any other Elements)
There you can increase the Size value. This increases the amount of vertices.
(increase it to a larger value. Deleting any excess later on)
*Note you have to move the vertices to see then the new ones will be created on the exact same location as the first element.
This way you will at least have plenty of vertices to work with: