transform.position to real center of a mesh, not the pivot, its posibel?

hello Guys,

i didnt know if it too newbie question, but i didnt found a answer

Did you know any way to get the real center of a GameObject instead the pivot, using transform.position?
Its possibe? Like Toggle the Pivot/Center button to center with code?

collider.bounds.center

–Eric

2 Likes

I’m not sure that collider.bounds.center includes the transformation itself, so you might need to do

transform.TransformPoint(collider.bounds.center)

1 Like