What am I doing wrong with 8Direction.MovingAngle?

0 favourites
  • 2 posts
From the Asset Store
Be quick and choose whether the shown equation is right or wrong.
  • I'm trying to do a small topdown thingy.

    In it, I want my player to move a bit in the direction he is moving when he attacks.

    To get the direction in which he is/was moving (with 8 movement behavior), I stock the Player.8direction.MovingAngle in a variable when he is moving (so it never returns to 0 except when it is the correct angle). This variable works.

    After that, I use Custom Movement to move the player (if I simply use the "Move at Angle" or "Move Forward" action it only 'teleports' the object). I use the action "Accelerate towards Angle" and use the variable I used before.

    And it doesn't work. I don't get why, sometimes it slightly change for a weird angle, but I really don't get where is the problem.

    Here is the event:

    And here is the capx:

    http://we.tl/viHbjScBWH

    Thanks a lot for your help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're enabling the Custom Movement Behaviour only after you have moved the player. The "Set Custom Movement Enabled" should be the first thing below "Set isAttacking to True".

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