How do I find the size of a gameObject?

How do I find the size of a gameObject? For example the length of x.

Use Mesh.bounds.size.

Well I came here looking for an objects unit size. I tried Mesh.size, but wasn’t the objects unit size. Since it tells you the size of the mesh, not of the scaled mesh. So if you just multiply Mesh.size by transform.localScale, you will get the objects unit size.

a plane in unity is 1, 1, 1 and it’s unit (or mesh size) is 10, 0.00002(ish), 10. So if you scale the plans x by 5. It’s unit size is 50 even AFTER scaling these are the sizes.

mesh.bounds.size.x = 10
transform.localScale.x = 5


mesh.bounds.size.x * transform.localScale.x = 50

It appears Transform.LossyScale does what you are looking for