Take the following code, which is called when OnPointerClick is fired.
public override bool IsRaycastLocationValid(Vector2 screenPoint, Camera eventCamera)
{
Vector3 point;
if (RectTransformUtility.ScreenPointToWorldPointInRectangle(rectTransform, screenPoint,
eventCamera, out point))
{
return edgeCollider2D.OverlapPoint(point);
}
return false;
}
With:
‘Screen Space - Overlay’ - Everything works as expected.
With:
‘Screen Space - Camera’ - This function returns true, even when the click is way outside the EdgeCollider2D (note: the eventCamera being passed is correct).
Can anyone tell me what I missing?