How do I make my character move correspondingly when I...

0 favourites
  • 5 posts
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • ...hold down two keys at once to move?

    So atm, my character moves with WASD, the usual. But when I, say, press W and A, to make my character go NW, it goes in the complete opposite direction.

    Is there a way to program my character to move properly with WASD, and when two keys are held down it moves in the correct in-between direction?

  • Could u put a screensplash of your "code"?

  • Is your character using the 8Direction behavior, gomotion100?

  • Try Construct 3

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

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

    • Insert a "Keyboard" object.
    • Make an event: Keyboard -> Key Is Down -> "W"
    • Make an action: Player (or whatever you are calling it) -> 8Direction -> Simulate 8Direction pressing Up
    • Make an event: Keyboard -> Key Is Down -> "A"
    • Make an action: Player -> 8Direction -> Simulate 8Direction pressing Left
    • Make an event: Keyboard -> Key is Down -> "S"
    • Make an action: Player -> 8Direction -> Simulate 8Direction pressing Down
    • Make an event: Keyboard -> Key is Down -> "D"
    • Make an action: Player -> 8Direction -> Simulate 8Direction pressing Right

    Also, check in your properties panel and make sure the "Directions" property is set to 8 Directions.

    Does that help?

    theman3446~

  • I usually do it this way:

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