How can you move an entire polygon collider 2d to reposition it on a sprite, without having to re-drag all the collider verts?
re-doing the collision is certainly seconds and easy, but I’m wondering if there’s some kbd shortcut to just select the collider and reposition it on the sprite?
ie: you may resize the sprite to cut off some dead space, and the sprite re-centers in the bounds, but the polygon collider does not, and is now offset from the sprite image.
Hmmm…appears you can re-drag the sprite texture onto the polygon collider component and it re-generates the collision, but you still have to edit it by hand, so still wondering if there’s a way to move the whole collider.
You could make a simple editor script for it…(which moves all the verts)
(spam)
I have move all verts (by given offset) function in this asset store plugin, also has reset collider button (for multiselect):
*Or if you just want to update the collider, right click & reset on the PolygonCollider2D
(you could make a editor script for that also…to reset all, if multiselection & reset doesnt work)
Not that bothered by it. Just wanted to see if there was a Unity shortcut I was missing. I can’t seem to find a way to multi-select all the collider verts in editor.
re: reset - that simply regenerates the collision, so you have to hand optimize it again, so no benefit.