Simulate Right not working

Discussion and feedback on Construct 2

Post » Thu Oct 16, 2014 10:35 am

I have a platform behaviour that I can simulate jump but not moving right. It works if the default keys are enabled but not if I try and customise them. Why is this?
You do not have the required permissions to view the files attached to this post.
B
4
S
1
G
2
Posts: 42
Reputation: 961

Post » Thu Oct 16, 2014 10:42 am

Your condition says "on key pressed" - that's a single button press. So the player presses a button once, and a single action happens because of it. If you want to read a continued button press, you need to use the action "is key down". This is an important difference to know and understand, as events in Construct are either based around single or continued triggers.
B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Post » Thu Oct 16, 2014 11:29 am

Thanks. What confused me was that key pressed worked for Jump. Any why changed them both to Key Down and all good :-)
B
4
S
1
G
2
Posts: 42
Reputation: 961

Post » Thu Oct 16, 2014 2:05 pm

@abasel you'd want to keep the "on key is pressed" for the jump. While construct is smart enough to know and the player wont go up flying, some times is better to make the jumping with the set vector Y action and a negative number (-650 will have the same result as the default jump). This can be useful for wall jumps and other non standard cases.

Have in mind that there are things that act as triggers (press this and a light turns on) and other things that need constant feed in order to execute (like gradually moving something a distance over time). Jumping falls in to the first category, as you can only jump once per jump and only if you are grounded. The movement on the other hand needs constant input feed in order to know for how long should the player move.

Events/conditions that act as triggers are depicted in Construct with a green arrow on the left side of the event. Otherwise, the events run every single tick. If you want an event to run only once and act as a trigger, you can add the "Trigger once while true" condition. This can be found under the system conditions.
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests