Page 1 of 1

Help

PostPosted: Sat May 27, 2006 2:58 am
by CrimsonX
I currently have 2 questions. If its not too much please explain step by step.

1. My character has the punch animation enabled, But when i press the punch button it only punches in one direction. How to i create it to where i can punch left when facing left and punch right when facing right with my a button.

PostPosted: Sat May 27, 2006 4:18 am
by DilloDude
On keydown, check one of two things:
  1. the face direction: if you aare using a variable for facing direction, you can check this
  2. the animindex: if you aren't, you can check the current animation (although it will get annoying if you have lots of animations, like walk, stop, jump etc.)

So you are using the first method:
Code: Select all
switch(facedir)
{
    case RIGHT: //either change this to a number (1) or use #define RGHT 1 in global code
    ChangeAnimation("Event Actor", "Punch_Right", FORWARD);
    break;

    case LEFT: //see for RIGHT
    ChangeAnimation("Event Actor", "Punch_Left", FORWARD);
}