Animations not working with touchpad?

0 favourites
  • 9 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Hello, in my game I had keyboard controls to try playing my game and the animations work. But when I try using a touchpad to move the player the walking animations and attacking animations don't play despite working with keyboard controls. Help would be greatly appreciated.

    Project file

    drive.google.com/open

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use System condition "Is between angles" instead of "Compare instance variable" in your TouchPad group in events 121-142.

    Also, in event 121 you have a mistake, the range should be -22.5 to 22.5

  • Thanks for pointing out my error in event 121, but could you explain further on using the system condition "Is between angles"? I'm not sure I understand how to use that condition. Screenshots would help greatly if possible as well, thanks.

    These are what I've tried but it still doesn't seem to work so I think I'm doing something wrong.

  • Like this:

    Because angles in Construct can take negative and positive numbers, it's tricky to compare them. It's much easier to use specific conditions and expressions - "between angles" instead of "between values", "is clockwise from" instead of "is greater", anglelerp() instead of lerp() and so on.

  • Thank you for the advice, however, I've tried your code and the animations still don't work when I move with the touchpad.

  • So the character moves correctly and mirrors, but animations are not playing? Could you re-upload the changed file? In the previous version it couldn't even move properly with the touchpad.

    EDIT: Actually, no need. The problem is that your two groups (Player Movement and TouchPad) are clashing. When no keys are pressed, your events 21-28 reset animation to "Idle" on every tick.

    Since you have more than one way to control the character, the best solution would be creating a separate group that will manage animations, not based on control method, but based on 8direction moving angle.

    Something like this:

  • I fixed it thanks to your help, the problem was that my keyboard controls were messing with my touchpad controls for some reason. Here's the file if you're interested. But I only get a black screen when I try to test the debug apk on my Android device, could you please help with that as well?

    drive.google.com/open

  • See my edited comment above.

  • Thank you very much, you've been a huge help!

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