How do I make 8-Direction diagonal movement speed match normal movement?

0 favourites
  • 4 posts
From the Asset Store
Character Sprite Pack: Walk 4 Directions made in illustrator
  • Hi,

    There's an issue with the 8-Direction behavior that causes diagonal movement to be slower than movement in cardinal directions.

    My character is supposed to move 60 pixels per second in any given direction. This works with cardinal directions, but when I move in 2 directions (for example, down and left) the character moves 42 pixels per second in both directions instead.

    How do I fix this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • so basically let's try this:

    measure one tick of movement!!

    measure the distance from (0, 0) to (60, 0)

    measure the distance from (0, 0) to (42.42, 42.42)

    The result is the answer

  • so basically let's try this:

    measure one tick of movement!!

    measure the distance from (0, 0) to (60, 0)

    measure the distance from (0, 0) to (42.42, 42.42)

    The result is the answer

    I’m not sure I follow. My question was asking how to get the diagonal movement speed to match the cardinal movement speed, as 8-Direction diagonal movement seems to always be slower than cardinal movement. I want them to be the same speed.

  • The diagonal speed is already the same as the cardinal speed. The magnitude of the vector (0, 60) is the same as the magnitude of the vector (42.42, 42.42).

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