AnimationFinish in script editor?
Posted: Wed Aug 22, 2012 8:24 pm
I'm using the state method to try and add an ability the character can achieve later on in the game. Things are getting complicated for me and I'm having trouble wrapping my mind around what's happening.
BUT, I don't want you to have to hold the button down to stay flat, I want you to have to press the up key while you are squished to pop back up into the normal idle state.
with that in mind, should I still use the state integer for squishing, or should i create a new int for squish? I dunno, maybe I'm thinking about it too hard and overlooking the obvious, which I tend to do a lot while coding.
this is what i have for they keydown>up:
any suggestions?
- Code: Select all
switch(state)
{
case 0: //if floober is standing facing right
case 2: //or walking to the right
ChangeAnimation("Event Actor", "floober_squish_right1", FORWARD); //play the squishing animation
//here I want the code: upon animationfinish, changeanimation to flat floober,
state=6; //and then change state to 6.
break; //finish executing this block of code
}
BUT, I don't want you to have to hold the button down to stay flat, I want you to have to press the up key while you are squished to pop back up into the normal idle state.
with that in mind, should I still use the state integer for squishing, or should i create a new int for squish? I dunno, maybe I'm thinking about it too hard and overlooking the obvious, which I tend to do a lot while coding.
this is what i have for they keydown>up:
- Code: Select all
switch(state)
{
case 6: //if you are squished and you press the up key
ChangeAnimation("Event Actor", "floober_shlop_right1", FORWARD); //play the animation of floober popping up off the ground and returning to his idle state.
// here I want an animation finish code to tell floober to play the idle_right animation once finished with popping up off the ground.
state=0; //return to the idle_right state.
break;
}
any suggestions?