How do I disable one single key?

Get help using Construct 2

Post » Tue Sep 08, 2015 11:46 am

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.
B
28
S
11
G
1
Posts: 163
Reputation: 2,880

Post » Tue Sep 08, 2015 12:04 pm

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.

how-to-change-controls-s_t65443
B
7
S
2
Posts: 92
Reputation: 663

Post » Tue Sep 08, 2015 12:08 pm

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!
B
28
S
11
G
1
Posts: 163
Reputation: 2,880

Post » Tue Sep 08, 2015 12:11 pm

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.
ImageImageImage
B
31
S
19
G
82
Posts: 1,038
Reputation: 46,205

Post » Tue Sep 08, 2015 12:50 pm

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 :)
B
7
S
2
Posts: 92
Reputation: 663


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests