i am going to make a fuel guage sysbol or label or somethings that display the level of the fuel inside helicopter is having,the problem is that i totally have no idea where to start have,so can anyone gave me so info about this,or any source which helpfu to this Thx
You can achieve that result with a bar that progressively decrease its content, like those health bars over the head of enemies in arcade FPS, or shoot 'em up games.
Here you can find some guidelines to make a bar like that: How would you make an energy bar, loading progress bar, health meter, or other visual gradually fill up? - Questions & Answers - Unity Discussions
While here you can read an interesting topic regarding a circular progress bar:
Maybe you would like something similar for your helicopter.
Strangely enough, I’ve done this exact thing. I created an image of the background of an instrument panel including gauges and mapped it to a game object. Then I created needles as overlaying game objects. The code rotates the needles based on game generated values. You can see an image of this and a problem I had here in Unity Answers: weird-rendering-error.html
dave can you help me up pls:
i currently have saved 10 texture
Fuel0=100 Fuel1=90 Fuel2=80 Fuel3=70 Fuel4=60 Fuel5=50 Fuel6=40 Fuel7=30 Fuel8=20 Fuel9=10 Fuel10=0
So i wanted to write the script as if when helicopter fly will slowly decrease or after sometimes will decrease and when helicopter stop it will stop decreasing and if fuel10=0 helicopter fall and explosion.
Some of my thinking may be include in script:timer every 10min decrease by 10…
var s = 0; var m = 0; var h = 0;
s++; if (s == 60) {
s = 0; m += 1; }
if ( m == 60) {
s = 0; m = 0; h += 1; }
if (m +=10){
t+=1
}
function OnGUI();{
GUI.Label( Rect( 20, 530, 128, 128 ), Fuel[ 0+t] );
}
So i wanted it to be for every10min Fuel0 become Fuel1 which will 0+1…+2…+3
and i doesnt how to write it,could you kindly help me with it,Thx