Character follow Touch - Animations [SOLVED]

0 favourites
From the Asset Store
4 Block Soldiers with different animations, 400x400
  • Been using C2 for a couple of days so I am complete beginner. I am stuck at this problem now and cannot figure it out. I try to solve problems myself first, but for some things I just cannot find enough information, so I will just ask for a little time here

    I made the character move towards the touch, but I cannot add properly working animations to it (touch on left should activate walk left animation for example).

    This one shows only the walk right animation no matter what.

    This one shows only frame0 for walk up and down and does not show any animations.

    Help would be greatly appreciated

  • Sorry for bad typos, on my phone.

    **EDIT** I actually see some more problems. I'll take a look when I get access to my comp.

    In the first example I think I see two problems.

    First problem is that, in the block where you are checking the MapChar Directions, they are all in the same block. So they basicaly work as an 'and' condition. Which means they all have to be true.

    The second problem, which I believe is in the second example aswell.

    The Set Animation (play from start) is being called every frame when the touch is active. So the animation constantly starts over.

    I hope that made sense and that it'll help.

    It sounds like you like problem solving so I'll leave the solution for you to figure out.

  • Also:

    You only use exactly 4 direction?

    Because if not you need to have exactly 90° to play an animation.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • deathangel1479

    8 directions, but only 4 way animations.

    Eklofakka

    looking forward to your reply

  • now it has FaceLeft animation only :/ did I miss something?

  • You are basing it on a 8 direction's moving angle, and you use set angle and move pixels, which is not using 8 direction movement.

    Try basing it on your regular angle instead of 8 direction's moving angle.

    MapChar.Angle is between etc etc

  • Y, you angles are wrong, so last triggers...

    I have an example... But where... XD

    Ahhh.

    Its complete different, but has you angles in:

    angles

  • up 270 degrees 225 / 315

    right 0 degrees 315 / 45

    down 90 degrees 45 / 135

    left 180 degrees 135 / 225

    Assuming your default animation character is facing right in the image editor (0 degrees)

  • "Is between angle" only works clockwise. Convert to clockwise and then decode between 0 and 360.

  • 3 times same result XD

  • SOLVED

    yea, got wrong angles

    It works perfectly now and looks like this. thank you all for the time and effort!

  • And play from beginn works here?

    Because I use play from current.

    Edit: Think because yours dont run by tick. Y, is ok, my misstake.

  • And play from beginn works here?

    Because I use play from current.

    Edit: Think because yours dont run by tick. Y, is ok, my misstake.

    Unless stated / indicated / logically manipulated, otherwise, every event runs each tick.

  • Y, a click works on tick, but you dont click at tick.

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