# How do I get the angle of the player direction using 8 direction movement without rotating?

0 favourites
• 5 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
• Hi there,

Pretty much as above. I'm looking to store a variable that keeps track of the players angle of movement.

However, i'm not using the Set Angle function of the 8 direction movement as it won't work with the sprites we're using. So how can I keep track of the angle of the direction the player is moving in? Could I use the 8Direction.VectorX and VectorY to work this out somehow?

The variable I'm using is called MovingAngle

Many thanks!

Paul

• Hi there,

Pretty much as above. I'm looking to store a variable that keeps track of the players angle of movement.

However, i'm not using the Set Angle function of the 8 direction movement as it won't work with the sprites we're using. So how can I keep track of the angle of the direction the player is moving in? Could I use the 8Direction.VectorX and VectorY to work this out somehow?

The variable I'm using is called MovingAngle

Many thanks!

Paul

This gives you the moving angle of the sprite.

If that's what you meant?

• Oh my lord, what a fool!

Thank you so much!

• The only issue I can with that is that the Angle from the 8Direction resets to zero upon a collision with a solid, so I can't use it. Could I work it out from the Vectors do you think?

• ## Try Construct 3

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

Construct 3 users don't see these ads
• is it a top down game?

if it is ... just set the angle of the player to the angle of movement if that is possible then use the player.angle depends now if the player is facing the direction he is moving towards. we need a bit more details on it. but usually that should solve it.

why does the angle of the 8 way movement character resets itself? is it cause of coding? or is a glitch?

• 5 posts