How do I disable one single key?

0 favourites
  • 5 posts
From the Asset Store
Random Maze Generator with Door & Key System - tutorial capx
  • I'm making a platformer, but I have a level where the player is constantly running.

    The whole level, the player is moving right automatically. However, when the user presses the Left Key, the player stops.

    Is there a way to disable the left key? ONLY the left key? I need the other keys, stop Ignore input isn't an option.

  • Hm, this is why you should make custom movement. Then you have control over the small details. I don't usually use predefined behaviors unless they work perfectly for what I'm doing. I'm kind of a ground up developer. If you knew what your keys were doing, and how they were coded, you could do whatever you wanted...

    Check this thread though. There's a conversation on the topic, and some links to some solutions.

  • I do have custom controls, however they're all on the same event sheet. I'd have to create another event sheet and only put the controls I need for this, and then include the event sheet in the current one used for that level.

    I was just wondering if there was a quicker solution ^-^ I shall check out that link now, thanks

    EDIT: Oh! Now I know what you mean. All solved!

  • On left key pressed -> Player simulate Platform pressing right? Just a guess.

    If this wont work then you have to disable default controls, and set it manually.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To disable a custom control you don't need a separate event sheet. Each key press should be on it's own event. If you want to disable one you could do it with a instance variable on the player and have it as a Boolean called canMoveLeft... set it to false when they can't move left. Use it as condition on the left key event. That should do the trick

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