Getting world position of SphereCollider?

I have a SphereCollider. I want to know the world position of the center of the collider.

The API provides collider.center which provides the center in local space.

Thank You

1 Like
2 Likes

OK, thanks. I tried that it works.
I also tried collider.bounds.center, which also seems to work the same.

collider.center is the center field/property, collider.bounds.center will calculate the bounds and thusly be slightly slower.

Of course… if the collider in question doesn’t have a ‘center’ field (like say a meshcollider), then you’ll have to use the bounds.