How to get center of collider in hierarchy

Hi, I want to find the Y position of 2 colliders in the following Hierarchy:

Player
--Colliders
---Collider1
---Collider2

So I have in a script attached to Player:

 var c1:GameObject;
 var c2:GameObject;
 c1= GameObject.Find("Player/Colliders/Collider1");
 c2= GameObject.Find("Player/Colliders/Collider2");

function Start () {
        Debug.Log ("C1: "+c1.transform.position.y);
    Debug.Log ("C2: "+c2.transform.position.y);
}

Both of them are returning 5, what Do I need to get the correct centers?

Values are .3 and -.6

Thanks in advance.

you are getting the transform's position which is the position of the gameobject itself that can be different from the center of your collider.

you can get a reference to object's collider by writing:

c1.collider

but Collider class don't have position/dimention information of your collider so you need to know the type of your collider and get it using GetComponent, let's say it's a SphereCollider

c1.GetComponent(SphereCollider).center

is the center of the sphereCollider attached to c1. it's a value in object's local space (0.3) as you said and you should add transform.position to it if you want to have it in world space.

Are you looking for transform.localPosition? transform.position is world space.

Thank you very much, used:

 c1.GetComponent(SphereCollider).center

and got what I needed. Regards.