Keyboard and Controller behaving differently, despite using the same actions

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
Small pixel icons for the 3 most popular controller types.
  • Hi, I've got a bit of a weird problem. I've set up movement of my character with both keyboard and gamepad controls using or logic. I have a turn animation, so for instance if the character is facing left and you hold down the right key they will turn and that animation should execute before they start moving right. What's really weird is that this works fine when using the keyboard - the turn executes properly. But when using the d-pad on a controller it skips the turn entirely. As they both share the same actions, I'm not sure what is up! Could anyone take a quick look and let me know if you have any ideas?

  • What happens if you use both, but in opposite directions?

    You could try separating this process into steps. Define an input "vector" (really a number from -1 to 1). Initialize the vector every step to 0. If keyboard left down, subtract 1 from the vector. If D-pad left down, subtract 1. If keyboard right, add. If D-pad right, add. Then normalize the vector (set to -1 if less than -1, 1 if greater than 1).

    Handle animation and movement next, based on the value of your input vector.

  • Have you disabled default controls?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try these changes. Avoid using "Trigger once" condition where it's not required.

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