how to change sphere/capsule collider, it sizes and the center

I made an enemy that can transform into ball and robot. The enemy start as a ball with sphere collider and when I get closer it transform into robot. The problem is when it transform into robot, it’s need to change the collider onto capsule collider because it’s legs don’t have a collision so they go through the floor. I sucsseed to switch between the colliders tipes but when I tried to change the size and centers - it don’t do that and don’t change the collider tipe anymore. How do I change the collider tipe, size and centers?

This is what I did so far:

function Attack ()
 {
     if (canAttack)
	 {
		 rigidbody.AddForce(transform.up * 40);
		 animation.Play("TransformRobot");
		 yield WaitForSeconds (0.3);
		 Destroy(collider);
		 var capsuleCollider = GetComponent ("CapsuleCollider") as CapsuleCollider;
		 capsuleCollider.height = 5;
		 capsuleCollider.radius = 2;
		 capsuleCollider.center.y = -0.5;
		 canAttack = false;
	 }
 }
 
 function FindWaypoints ()
 {
     if (!canAttack)
	 {
	     rigidbody.AddForce(transform.up * 40);
		 animation.Play("TransformBall");
		 yield WaitForSeconds (0.3);
		 Destroy(collider);
		 var sphereCollider = GetComponent ("SphereCollider") as SphereCollider;
		 sphereCollider.radius = 2;
		 canAttack = true;
		 rigidbody.AddForce(transform.forward * 100);
	 }
 }

Now I have (after you asked). But how I can enable/diable them when I need?

ANSWER: What i did was i created two empty game objects underneath my Player GameObject. I named one CapsuleCollider and another BoxCollider. I attached a Capsule Collider to the one named Capsule Collider and I attached a Box Collider to the one named BoxCollider. I have a GameMaster Script attached to another empty GameObject where I have created two public GameObject capsuleCollider and public GameObject boxCollider. From the inspector i drag the appropriate BoxCollider GameObject to the GameMaster public GameObject boxCollider field. Then I can just disable them in the script with

capsuleCollider = GameObject.GetComponent(<CapsuleCollider>);

capsuleCollider.enabled = false;

Genius cityseeker! That even solved my problem!