Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

I need help with my Healthbar.

$
0
0
Hello everyone. So I work on a HealthBar for my game, but I dont know how I can make the script recognize the image. The rest worked normally and it changed the Scene after I got hit 3 times. The only thing is, that it wont show it to me ingame. Thanks a lot in advance. #pragma strict var HP = 3; var x = HP/3; Update(); var reload : String; var Content : String; function OnTriggerEnter (Col: Collider) { if(Col.CompareTag ("Enemy")) { if(HP == 0) { Tod(); } else HP--; } } function Tod() { Application.LoadLevel(reload); } function Update() { Content.fillAmount = x; }

Viewing all articles
Browse latest Browse all 1875

Trending Articles



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