4.6 how to scale Box Collider2d with screen size?


i am using the anchors method and Scale With Screen Size from the canvas to scale any image on any resolution but the problem is the collider stays at the same size.

m not sure this will resolve your issue or not but you can add collider after you render image scale up/down

void Start()
//when unity starts it will scale image after that  start is called  you need to add collider to images via script 
// which will be perfect size collider 


If its only about UI Element then you can add Selectable Script to the image (remove collider).

and add a script that implements the pointerlisteners

using UnityEngine.UI;
using UnityEngine.EventSystems;

public class Test : MonoBehaviour,IPointerDownHandler {

	#region IPointerDownHandler implementation

	public void OnPointerDown (PointerEventData eventData)
		Debug.Log (eventData);
                //This will be called on touching the image


There are many other ways to achieve it. Hope this helps