x


Is it okay to use triggers for a chain combo?

Whenever I see combo scripts they are mostly based on time, I haven't been able to fully grasp them as I'm still an amateur scripter, but I tried it with Triggers. It seams like it could work just fine, are there any reasons that I'm not aware of why this might be a bad idea? Here's the script.

function Attack() {
//play propper animation if attack is true, if next attack isn't triggered, go back to first attack.
if(attack1 == true) {
if(Input.GetButton("Jump")) {
animation.CrossFade("atk1");
yield WaitForSeconds(.4);
attack2 = true;
attack1 = false;
}
}

if(attack2 == true) {
if(Input.GetButton("Jump")){
animation.CrossFade("atk2");
yield WaitForSeconds(.5);
attack3 = true;
attack2 = false;
} 
else{
yield WaitForSeconds(.3);
attack1 = true;
attack2 = false;
}
} 

if(attack3 == true) {
if(Input.GetButton("Jump")){
animation.CrossFade("atk3");
yield WaitForSeconds(.5);
attack1 = true;
attack3 = false;
}
else{
yield WaitForSeconds(.3);
attack1 = true;
attack3= false;
}
}

}
more ▼

asked Mar 08 '11 at 07:16 PM

Wes 1 gravatar image

Wes 1
40 18 18 22

On first glance it would seem you execute a combo and continue doing it whether your attack connects with an enemy or not. If this is not a problem (because of points based on combo or something similar) it seems fine to me.

Mar 08 '11 at 08:11 PM Joshua
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x980
x156
x14

asked: Mar 08 '11 at 07:16 PM

Seen: 561 times

Last Updated: Mar 08 '11 at 07:16 PM