Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Fix this script?

$
0
0
I saw this script and I tried it out but it doesnt work because of the following error Assets/Scripts/Hunger.js(26,25): BCE0044: unexpected char: 0x200B. Could someone perhaps fix it. var Health : int = 100; var MaxHealth : int = 100; var Hunger : int = 100; var Timer : float; var Texture1 : Texture2D; var Texture2 : Texture2D; var BarLength : int = 100; private var Speed : int = 3; function Update () { Health = Mathf.Clamp(Health, 0, MaxHealth); if(Health > 0){ Timer += Time.deltaTime; if(Timer >= Speed) { if(Hunger >= 85) { Health += 3; } if(Hunger <= 0){ Health -= 1; Speed = 1; } else {​ Hunger -= 1; Speed = 3; } Timer = 0; } } } function OnGUI () { GUI.DrawTexture(Rect(400,400,100*Hunger/BarLength,20),Texture1); GUI.DrawTexture(Rect(400,430,100*Health/BarLength,20),Texture2); }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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