how can i make killstreaks in unityi am dying to learn it can someone give me a good tutorial on how to do it thank you in advance
Make an integer variable which stores kills since last death. Some pseudocode: Code: var ksld = 0; function onKill(){ ++ksld; if(ksld == 5){ //5 killstreak //do the killstreak } } function onDeath(){ ksld = 0; }
Originally Posted by Saltine Make an integer variable which stores kills since last death. Some pseudocode: Code: var ksld = 0; function onKill(){ ++ksld; if(ksld == 5){ //5 killstreak //do the killstreak } } function onDeath(){ ksld = 0; } That wouldn't full work. Code: static var killTimer=0; function Update() { InvokeRepeating ("Countdown", 1.0, 1.0); } function Countdown() { if (--killTimer == 0) CancelInvoke ("Countdown"); }
Originally Posted by APEsmoker That wouldn't full work. Code: static var killTimer=0; function Update() { InvokeRepeating ("Countdown", 1.0, 1.0); } function Countdown() { if (--killTimer == 0) CancelInvoke ("Countdown"); } He wanted kill streaks not a kill timer?