I have a GameObject in my scene.
and I want to get the width and height of it.
How?
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.
Not sure what terrains have to do with the question. You can get dimensions of an object by using mesh.bounds.
–Eric
Thanks a lot.
I solve it by using renderer.bound.