I am having some trouble getting Physics.SphereCast to work as I expect. My reason for using this method is to get some extra "padding" around my standard mouse raycast for touch input.
The following code snippet works just fine:
RaycastHit hit;
if (!Framework.IsMouseBlocked &&
Physics.Raycast(Framework.MouseRay, out hit, 1000, (1 << 8)))
m_hover_object = (Decoration)hit.transform.GetComponent(typeof(Decoration));
else
m_hover_object = null;
This code does not work however:
RaycastHit hit;
if (Physics.SphereCast(Framework.MouseRay.origin, 15, Framework.MouseRay.direction, out hit, 1000))
m_hover_object = hit.transform.GetComponent<Decoration>();
else
m_hover_object = null;
The purpose for using the orgin/direction override of SphereCast was just to test and see if I got a different result. My initial attempt was using the Ray override for the method, this also failed.
The selection never returns any results even when used in situations where the RayCast does.