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;
}
}
}