Problems changing the radius of the collider that has just RaycastHit

I have a simple RaycastHit script which changes some of the parameters of the object that is hit. So far they all work except for trying to change the radius of the collider that is being hit. I’m pretty sure this is fairly simple but I can’t seem to get it. Help would be appreciated.

#pragma strict

var hit : RaycastHit;

function Update () {
	if(Input.GetMouseButtonDown(0)){
			
		var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
		
		if (Physics.Raycast (ray, hit, 20)){
			//these work
			hit.collider.gameObject.transform.localScale = Vector3(0.5,0.5,0.5);
			hit.collider.gameObject.tag = "StartingPoint";
			//this one doesn't	
			hit.collider.gameObject.collider.radius = .5;
		}
	}
}

I think I’ve determined that this is a #pragma strict syntax issue. Any suggestions on how to properly write the following line?

hit.collider.gameObject.collider.radius = .5;

I tried this but no luck.

hit.collider.radius = .5;

Still no luck. I’ve tried all the variations I can think of. Help please.

The object returned in the RaycastHit is a Collider but the radius property is specific to the SphereCollider class. You should cast the collider to SphereCollider before assigning the radius:-

var sphere: SphereCollider = hit.collider as SphereCollider;
sphere.radius = 0.5;

Great. Thanks for the help.