Sorry for not being specific. I was writing in a hurry. (I'm also now writing in a hurry)
However, you can make like this:
Go to 'attack key down' -> script editor
then create a variable called compass
Then add this code
- Code: Select all
if (compass == -1)
{
ChangeAnimation("Event Actor", "attacktoleftanimation", FORWARD);
}
if (compass == 1)
{
ChangeAnimation("Event Actor", "attacktorightanimation", FORWARD);
}
Then add this in the key down of the key when you walk right:
- Code: Select all
compass = 1;
and in the key down event of the key when you walk left:
- Code: Select all
compass = -1;
And still a small thing, in the create actor of your character:
- Code: Select all
compass = 1; //if the actor is looking to right in the beginning
I hope this helps.
NOTE: This is how to do it with left and right! If your game has for example 4 directions, just use 4 compass values. I used -1 and +1 just because it's easy to remember which one is left and which one right.