Strange behavior with keyboard keys & shift modifier

0 favourites
  • 9 posts
From the Asset Store
Design for game, asset for game, game kit, UI design, completed design for game, mobile game, Gravity Shift
  • I'm getting very strange occurrences in my game. The simple version is I have A and D mapped to left and right (simulating a platform behavior). That works fine. I also have shift mapped to a dash ability. My code makes sure you can't move while you're dashing. Overall, everything TECHNICALLY works exactly how it should.

    However, if I press and HOLD shift and a direction, sometimes it will dash, and then the player won't move. If I let go of shift while continue to hold the direction, after a half a second after releasing shift, the player will start to move again.

    When I remap shift to the right mouse button, this goes problem goes away. For some reason, the shift button being held is somehow stopping the other keys from being pressed or held. Does anyone have any insight as to why this would be happening?

    It's definitely not my code, because I just made a simple barebones test c3 project and it's happening in that, as well.

    https://www.dropbox.com/s/zs2toih3q95f8ua/ShiftKeyTest.c3p?dl=0

    Any help would be greatly appreciated!

  • You need to use trigger once on the events that are starting the tween. Otherwize it's kind of like the tween is triggered every tick while the shift key is held.

    Trigger once, or using the "On key pressed" also works.

    Conditions that fire once have a green arrow. Otherwize it will trigger every tick while the conditions are met.

  • Another thing.. Make sure you uncheck the "use default controls" on the platform object.. Can cause issues.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • tunepunk - actually you do not need trigger once for a key press (that green arrow means it’s already a trigger). Also having default controls on doesn’t affect the issue I’m having.

  • Wondering if anyone else has any insight on this?

  • I tried several different combinations of your events, and added else conditions...

    the D key does not register as down sometimes.

    so, it is either a bug in C3 or a bug in Chrome... (I didn't try other browsers)

  • AllanR - that was my guess, too.

    Ashley - any idea on this? I’d prefer to not waste your guys’ time by reporting a bug if it’s not necessarily a bug. I have a feeling it’s an HTML5 thing...

  • You can check the bug tracker for similar sounding issues. It might be this one.

  • Thank you!!

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