Hi Everyone
Is there any way to recalculate the polygon collider via script to match my sprite ? When I change my sprite via the inspector I use OnValidate to update the spriteRenderer.sprite property.
void OnValidate()
{
renderer = GetComponent<SpriteRenderer>();
renderer.sprite = idleImage;
}
I would like this to update the polygon collider in the editor to match. In the same way clicking the cog in the corner of the polygonCollider script in the inspector and selecting reset does. I don’t want to do this at runtime so I dont think performance should be an issue, Any ideas ?
Thanks