What am I doing wrong with 8Direction.MovingAngle?

Get help using Construct 2

Post » Wed Jun 24, 2015 11:41 am

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:
Image

And here is the capx:
http://we.tl/viHbjScBWH

Thanks a lot for your help!
B
6
S
2
G
1
Posts: 38
Reputation: 603

Post » Tue Jun 30, 2015 3:29 pm

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".
Banned User
B
6
S
3
Posts: 105
Reputation: 1,170


Return to How do I....?

Who is online

Users browsing this forum: Sparkz and 3 guests