Adding Custom Controls Issues

Just started using Construct 2? Post your questions here

Post » Tue Mar 25, 2014 11:35 pm

Hello guys,

So I've been trying to make a custom movement for a character and I'm still getting used to C2 so I found some issues doing this.

My problem right now is when I assign more than one key to move the character such as:

D = Move right and A = Move left.

The character seems just to respond to the last assigned key which was "A" key. I would be very thankful if someone more experienced could take a look at it and point out what I'm doing wrong, so I'll leave a .capx as an attachment.

If someone if wandering where did I got the animations for this character such as running and idle, you can get them at David Hellman's "Braid Graphic Briefcase", which a link I can't post as I'm a new member of C2 community.

Let me thank you in advance and I hope to get some help as I'm really excited learning this amazing tool. Thanks a lot!
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 11
Reputation: 222

Post » Wed Mar 26, 2014 11:41 am

Your else statement is in the wrong place.
It only reacts to the A is down. If A is not down the else statement takes over.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Mar 26, 2014 11:53 am

LittleStain wrote:Your else statement is in the wrong place.
It only reacts to the A is down. If A is not down the else statement takes over.


Hey thanks for helping, should I make a variable then? I've tried putting the else under "D" key and tried putting two elses one under "D" and another under "A" key and keeps doing the same problem.

Thanks a lot by the way, this is very helpful.
B
4
Posts: 11
Reputation: 222

Post » Wed Mar 26, 2014 12:11 pm

You could create a variable KeyDown.
and add an action to A is down and D is down to set the variable to 1
add an on any key released at the top of your inputs (so all events below will overwrite if necessary), give it the action set variable to 0
add an event if variable is 0 set CustomMovement speed to 0

This is probably not the best way, but it will work for now.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to Beginner's Questions

Who is online

Users browsing this forum: kainrazial and 4 guests