I recently started working with unity. i have created a simple game consisting of a vehicle moving in straight road which is predefined. i want to use the image for speedometer and other meters. i don’t know how to animate and keep changing the digits. any suggestions or links to tutorials?
2 Answers
2you should work with GUI to create the Cockpit.
with gui you can create strings displayed on your screen, and for the meters, backgroundimage, etc, you could use some guitextures.
you can find info about gui’s here:
overall gui - Unity - Scripting API: GUI
guitext - http://docs.unity3d.com/Documentation/ScriptReference/GUIText.html
guitexture - http://docs.unity3d.com/Documentation/ScriptReference/GUITexture.html
you can insert a GuiText and GuiTexture via GameObject>CreateOther>Guitext(ure).
you can edit its content via script.
if you want to display an INT into the GuiText, you have to make it a string first. this is easily be done by typing:
guiText.text = " " + 3;
or with a variable (hide the <>):
guiText.text = " " + ;
hope this helps.
Well, assuming that the blue rectangle around 150 is your pointer, then you could create a separate object, that has it’s own material as the pointer. Then you could rotate the pointer around the center of the speedometer depending on the speed.
