i’m using a float variable for my healthbar variables for current health and max health. Now i added the following script which allows health Re/Degeneration.
curHealth+=1*Time.deltaTime;
curHealth = Mathf.Clamp(curHealth,0,maxHealth);
this script works like it has to: it adds 1 to the variable curHealth every second, but it displays the curHealth variable in my healthbar GUI now as a very long float. How can i make that variable to show as int, and how can i get the variable to be handled as int when accessed by other scripts?
Thanks in advance.