- Home /
Question by
Jneumann2 · Apr 06, 2011 at 11:36 PM ·
guidisplayproperties
Display a objects property.
Hi! I would like to display the mass of a certain object on the screen. Example:
Say we have a cube object named CUBE. CUBE has a rigidbody attached to it. The rigidbody gives CUBE a mass property, and that property is x. How would I display x on the screen?
Comment
Best Answer
Answer by DaveA · Apr 06, 2011 at 11:39 PM
Please learn GUI, esp this: http://unity3d.com/support/documentation/ScriptReference/GUI.Label.html Should be close to what you want.
Basically, your OnGUI function will call GUI.Label which takes the rectangle where you want it displayed and text. That text will be the mass of your object.