Quantcast
Channel: Questions in topic: "die"
Viewing all articles
Browse latest Browse all 115

Player Health Damage

$
0
0
Hi guys, I have this health script I created for my player, can any one show me how I could integrate damage and death when the player comes close to an enemy? This is the only thing not working in my game and I have a project completion deadline of the 3rd May, so any kind of detailed help would be gratefully appreciated. Thanks in advance! var maxHealth : int = 100; var HealthGUI : GUIStyle; var rect1: float; var rect2: float; var rect3: float; var rect4: float; function Update () { if( maxHealth < 0){ maxHealth = 0; } if( maxHealth > 100){ maxHealth = 100; } } function OnGUI (){ GUI.Label(new Rect(Screen.width/rect1,Screen.height/rect2, Screen.width/rect3,Screen.height/rect4 ),""+maxHealth+"%",HealthGUI); }

Viewing all articles
Browse latest Browse all 115

Trending Articles



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