Using ngui and checking whether 2 2D polygon colliders intersect
Ok, working on creating one of those lovely spinning bonus wheels. So I have created a simple wheel, dividing into 8 sections. Each section has a ui2dsprite set up with a 2d polygon collider on it covering the whole wedge.
I have another ui2dsprite that sits on top, the ticker if you will, also set up with a collider. I've tried using polygon2d as well as boxcollider2d built into ngui.
My problem is for the last several hours I've been trying and failing to figure out how to determine if one of those sections intersects with the ticker. All of the normal bounds.intersects and all seem to return nothing. I tried multiple ways of checking, some are below. The raycast actually indicates a hit, but then always says hit is null..
Ray ray = Camera.main.ScreenPointToRay(mousePosition);
RaycastHit2D hit = Physics2D.Raycast(ray.origin, ray.direction);
if (hit == null)
{
Debug.LogError("No hit");
}
else
{
Debug.LogError("Hit something");
Debug.LogError(hit.transform.name);
}
// *****************
if (pointyThing.GetComponent<PolygonCollider2D>().IsTouching(wedges[x].GetComponent<PolygonCollider2D>()))
{
Debug.LogError("collided");
}
// *****************
if (pointyThing.GetComponent<Renderer>().bounds.Intersects(wedges[x].GetComponent<Renderer>().bounds))
{
Debug.LogError("collided");
}
If this wont work, how would you go about setting this up?
Sample image if it helps:

Help me while I still have hair!!
Your answer
Follow this Question
Related Questions
Finding an origin for two rays 0 Answers
NGUI depth issue 0 Answers
Clamp camera within bounds of a Polygon Collider? 1 Answer
Bounds.IntersectRay behavior when origin is inside bounds? 0 Answers