Ok 1st we need 2 actors
hero ( 2 frames of animation , 1 when he slashes and 1 where he is not )
enemy
Then you need to declare 1 variable
hit
Now lets begin!!
Click on hero // click on keydown // click on spacebar// click on add action // click on script editor //
ChangeAnimation (" put your slashing animation here");
hit=1;
click immediate action
Ok now click on your hero // click keyup // click the spacebar // click add action // script editor //
ChangeAnimation(" put your standing still animation here");
hit=0;
Now for the last step of your hero
Click on hero // click on collision // on any side of // enemy // add action // script editor //
- Code: Select all
if(hit==1)
{
DestroyActor("Collide Actor");
}
Click add action and now your almost done.