SphereCastAll question

Hey everyone,

I’m working on casting a sphere using SphereCastAll.
This is my code:

RaycastHit[] sphereHit = Physics.SphereCastAll(position, 4.0F, direction.normalized, 1000.0F);
			
for(int i = 0; i<sphereHit.Length; i++)
{
     print(sphereHit[i].transform.name);
}

It seems that only when there is a DIRECT hit (like a Physics.Raycast) do I get the list of colliders. If the collider is still within the radius of the spherecast, but not right in the middle, I don’t get any colliders. So basically, this is working for me just like a RayCast.
Anybody know why?

Thank you!!

try to use sphereHit*.colider insted of .transform*

Thanks :slight_smile: