0 Favourites

How do I move and attack at the same time

  • Hi there,

    Im new here and the problem is when i stand still and a press enter it attacks , but when i move (run) while press enter it wont do nothing, and with and extra sub event it disturb my running animations and idle animation.

    (meaning now for the moment its oke , when i run its running animation , and when i stand still the idle animation works fine, and if i press enter its attacks and go back to idle so great so far ,but when i want to attack while running , i do new sub event ........ and its all mest up.

    Please help out a new noob

    cheers from Belgium

    i would post a print screen but i dont now how to put it here :-s somebody help please

  • Hey

    You could make another animation... a running/attacking animation...

    Or you could make the arm a separate sprite. Then Pin it to the player, and have animations for it. (like running, or attacking)

    In this method you could have the arm doing anything while the body is still running.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Do you pin your animations to a controller sprite?

    You can avoid many animation issues by using a controller sprite object. Simply make a sprite that has your "characters" collision bounds (ie scaled to character sprite size with appropriate collision bounds) and then set it to invisible. Give your character that is animating a pin behavior and simply pin it to the "controller" sprite when it's spawned. The controller spite would get all the stuff you would put on your player.. instance variables, movement behavior, physics.. etc. and the animations would just be pinned to its location and not actually interacting with anything.

    In your example you could then pin other invisible sprites to the controller for sword collisions and such and match them to animations...

  • Make a separate attack animation and assign it to a different button. so if running is the right arrow down make the spacebar call your attack animation. Or if the running button and the spacebar are down at the same time attack. You could even do if the player is within a certain distance of the enemy you can call your attack animation.

  • many thanks for the reply's

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
564 105,204
rexrainbow's avatar
rexrainbow
Unread hot topic
234 61,227
DARKSETH's avatar
DARKSETH
Unread hot topic
99 10,137
karshinkoff's avatar
karshinkoff