Quantcast
Channel: Questions in topic: "enemy"
Viewing all articles
Browse latest Browse all 1488

Enemy Health Bar

$
0
0
i got this piece of simple code that works very well. var hit = 0; function OnTriggerEnter (other : Collider) { if(other.gameObject.tag == "Bullet") hit +=1; checkhit(); if(other.gameObject.tag == "Bullet1") hit +=5; checkhit(); } function checkhit(){ if(hit == 5){ Destroy(gameObject); } } Is there anyone out there who can help me please make a small health bar on top of the parent of the script that displays health as the numbers progress? Something like this... ![alt text][1] or this.... ![alt text][2] And how would i go about implementing hit numbers that display amount of damage like -1 as i hit them? like this ![alt text][3] [1]: http://www.quartertothree.com/fp/wp-content/uploads/2011/09/D3_hp.jpg [2]: http://www.onrpg.com/wp-content/uploads/2014/03/LeagueOfLegendsFullPush.jpg [3]: http://cloud-4.steampowered.com/ugc/577849023631006421/80D5E0BE6B4A4A60EA214BE1FBFAB6AB13E2E030/637x358.resizedimage

Viewing all articles
Browse latest Browse all 1488

Trending Articles



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