Hitting with a sword

wesai

  • Posts: 1
Hello guys, I'm new using StencylWorks and I would like to know how to created a command like hitting the A button and my character will swing his sword to attack an enemy.

I already have a swinging sword animation, so what I need is a way to make that work and be recognized as an attack. Also, how do I set the attack range of my sword?

Thanks in advance. :)

mikbob

  • Posts: 493
Hello guys, I'm new using StencylWorks and I would like to know how to created a command like hitting the A button and my character will swing his sword to attack an enemy.

I already have a swinging sword animation, so what I need is a way to make that work and be recognized as an attack. Also, how do I set the attack range of my sword?

Thanks in advance. :)
Is the sword a actor by its self or not?

Visit Our Site!  http://www.mikbobgames.com
Play The Platforms 2!  http://bit.ly/theplatforms2
Check out our twitter!  www.twitter.com/mikbobgames

DeathWish

  • Posts: 31
Hello guys, I'm new using StencylWorks and I would like to know how to created a command like hitting the A button and my character will swing his sword to attack an enemy.

I already have a swinging sword animation, so what I need is a way to make that work and be recognized as an attack. Also, how do I set the attack range of my sword?

Thanks in advance. :)
Is the sword a actor by its self or not?
We don't need to know this.
To make it trigger, just make a new actor behavior, and put , if a was pressed, then inside, put
-Switch animation to (Animation attribute you want it to make)
-If this actor hit an actor, kill last collided actor


If is in Flow, If a was pressed is in user input (Originally if _ is down, but you change it), Switch animation to is in actor-drawing, this actor hit an actor is in collision, and kill last collided actor is in actor properties (Originally kill self).
Make attribute by going to attributes, create attribute, make it an animation attribute named "Animation" or something, and put that in switch animation to. Then, attach it to whichever actor has the sword, whether the actor is a sword alone or a sword with the human. Then, make it the animation you want-I'm sure you took the crash course or have already used the program so you know, though.

Hope this helps you. By the way, if something fails-

-If the animation doesn't go back to the normal, download animation manager-Note that this may break some animations in-game, so if it does, deactivate it.


If you have any more problems, PM me.