Question by
qandeelsfacebook · Sep 27, 2016 at 10:39 AM ·
unity 5collider2drecttransform
How to change size of collider attached to UI Image.
I have a circle image which has a Cicle collider 2D and Rigidbody 2D attached to it and its size (width and height) is constantly increasing in script like this:
rt = circle.GetComponent<RectTransform>();
float width = rt.rect.width + increment;
float height = rt.rect.height + increment;
rt.sizeDelta = new Vector2 (width, height);
The collider doesn't change size with UI Image as it expands...what should i do in order to make the collider change size as UI Image changes size.
Comment