unity3d 碰撞中不检测图片透明部分怎么弄啊
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);//从摄像机发出到点击坐标的射线
RaycastHit hitInfo;
if (Physics.Raycast(ray, out hitInfo))
{
//Debug.DrawLine(ray.origin, hitInfo.point);//划出射线,在scene视图中能看到由摄像机发射出的射线
GameObject gameObj = hitInfo.collider.gameObject;
//Debug.Log(gameObj.name);
selectObj = gameObj;
Vector3 Mousepoint = Camera.main.ScreenToWorldPoint(Input.mousePosition);
MouseDownPostion = new Vector3(gameObj.transform.position.x - Mousepoint.x, gameObj.transform.position.y - Mousepoint.y, 0);
isMouseDown = true;
}
用的collider box来检测碰撞,但是目标是sprite,包含透明通道,所以想点在透明的部分就不被碰撞检测到该怎么办或者提供下思路呢