Quantcast
Channel: Questions in topic: "melee"
Viewing all articles
Browse latest Browse all 201

Melee Combat Script Help

$
0
0
i have made a melee script but it is not doing anything at all here it is: var InCombat : boolean = false; static var EnemyHealth; static var MeleeLevel; var SwordBonus = 20; function Start(){ InCombat = false; if(Input.GetKeyUp(KeyCode.F)){ Attack(); } } function Attack(){ InCombat = true; if(Input.GetKeyUp(KeyCode.F)){ EnemyHealth -= SwordBonus * MeleeLevel / 4; } } i want it to so if when it starts you are not in combat so you can not attack right away but if you press f then it turns combat on and you can attack right away but it does not do anything to the enemy i have enemy health script but it does not take damage from my script every time i press f the boolean doesn't even turn on or the enemy doesn't take damage please help.

Viewing all articles
Browse latest Browse all 201

Trending Articles



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