- Home /
Mesh height
I am trying to figure out the height of my model to place gui health bars on top of it. The problem is every method I have tried returns 0 as the height. Here are some things I have tried. Help would be much appreciated.
height = (int)GetComponent().bounds.extents.y;
height = (int)GetComponent().bounds.size.y;
height = (int)GetComponent().mesh.bounds.size.y;
I tried these with MeshRenderer and MeshFilter.
Comment
Answer by YoungDeveloper · Dec 19, 2013 at 05:37 AM
You can place empty gameobject on top of your model and child it. Then just draw the health gui in that gameobject coordinates.
Your answer
Follow this Question
Related Questions
Editing Terrain Topology at Runtime 0 Answers
Get height of a Mesh by X and Z coordinates 1 Answer
How can I get mesh height? 0 Answers
Simple mesh height alteration. 1 Answer