More animations

0 favourites
  • 11 posts
From the Asset Store
4 Block Soldiers with different animations, 400x400
  • How to add more animation to the game?

    I'm a beginner and I'm using Construct 2.

    In my project, all animations are triggered of the angle. But I don't understand how to add a new animation called attack that responds to a mouse click.

    I've already tried a bunch of options befor, but they all ended in failure

    (The image shows where I laft off andn what I already have)

  • This is a common issue, it is because the walk or idle animations override the attack. So if you are moving or not, it will always try to play walk/idle even if you shoot. The way to fix is to add more conditions such as 'attack animation is not playing' under walk anims. Problem is you have many different anims so a variable might work here. When you want to attack set an instance variable for attack to 1 and then back to 0 when the attack is over, then with your moving/walking animations add condition variable for attack equal to 0.

  • Yes, I added a variabel, and the attack animation starts working, but the idle animation stops working. I even tried to use a couple of variabels simultaneously, but still, one animation blocked the other.

  • The idle animation condition should be something like '8 direction is not moving + attack=0'. Also on the attack events you need actions to set the variable to 1 and then back to 0.

  • Yes, this is icredible work, I even think that I have already overcome this difficulty. But there is one moment left, everything works corractly except the attack animations, i.e. he hits but only upwards. I even tried to cram all this work into one animation and just then break it into frames, but that didn't help either

  • You are hiding the events on the screenshot..

  • OK, here's an addition to the first screenschoot

  • It's the same as original issue, attack is always 0. You didn't set it to 1 when you attack.

  • like this?

    if so, only the topmost animation out of the four is working

  • Nope that is a condition if attack=1, you want to set attack to 1 with the action when you click the mouse. Then you can add a timer or wait, or perhaps say 'on attack animation finished' and set it back to attack=0. The idea is to set attack to 1 when you attack so the walk animations will not play.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry, but as it turned out everything is fine, I just made a mistake in the frames, everything works fine. thanks for the help.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)