# How to get objects width and height

**URL:** https://discussions.unity.com/t/how-to-get-objects-width-and-height/414406
**Category:** Scripting
**Tags:** Scripting
**Created:** [May 24, 2010, 8:07am UTC](https://discussions.unity.com/t/how-to-get-objects-width-and-height/414406 "2010-05-24T08:07:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![anon\_68307275](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anon\_68307275](https://discussions.unity.com/u/anon_68307275)
#### Post date: [May 24, 2010, 8:07am UTC](https://discussions.unity.com/t/how-to-get-objects-width-and-height/414406/1 "2010-05-24T08:07:02Z")

</div>

I have a GameObject in my scene.  
and I want to get the width and height of it.  
How?

---

<div class="post-metadata">

### Author: ![Dewy](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@Dewy](https://discussions.unity.com/u/Dewy)
#### Post date: [May 24, 2010, 8:29am UTC](https://discussions.unity.com/t/how-to-get-objects-width-and-height/414406/2 "2010-05-24T08:29:11Z")

</div>

Set the GameObject’s position to normalised terrain coordinates. Then use terrainData.GetHeights or terrainData.GetWidth to get an array of the height/width at the location which you got in step one.

---

<div class="post-metadata">

### Author: ![Eric5h5](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/eric5h5/32/44225_2.png) [@Eric5h5](https://discussions.unity.com/u/Eric5h5)
#### Post date: [May 24, 2010, 8:32am UTC](https://discussions.unity.com/t/how-to-get-objects-width-and-height/414406/3 "2010-05-24T08:32:35Z")

</div>

Not sure what terrains have to do with the question. You can get dimensions of an object by using mesh.bounds.

–Eric

---

<div class="post-metadata">

### Author: ![anon\_68307275](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anon\_68307275](https://discussions.unity.com/u/anon_68307275)
#### Post date: [May 24, 2010, 9:04am UTC](https://discussions.unity.com/t/how-to-get-objects-width-and-height/414406/4 "2010-05-24T09:04:28Z")

</div>

Thanks a lot.  
I solve it by using renderer.bound.
