Quantcast
Channel: Latest Questions by RoboticSarcasm
Viewing all articles
Browse latest Browse all 40

GUI.Label only showing variable name not value

$
0
0
Whenever i play the game it just shows currentHealth in the top left corner, which is the name of the var in stead of the actual value. As i am pretty horrible at coding, is there anyone smarter out here that can fix this code? #pragma strict var currentHealth : float = 100; var MaximumHealth : float = 100; var PlayerAlive = 1; function Start () { if (currentHealth > MaximumHealth) currentHealth = MaximumHealth; } function ApplyDamage (damage : float) { currentHealth -= damage; Debug.Log("Hit!"); if (currentHealth <= 0.0) { Application.LoadLevel("0"); } } function OnGUI() { GUI.Label(Rect(0,0,100,100), "currentHealth"); }

Viewing all articles
Browse latest Browse all 40

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>