Have a variable increase as a key is held down?

Get help using Construct 2

Post » Fri Apr 05, 2013 11:58 pm

The solution is painfully obvious, but it doesn't seem to work.



Whenever I test it, the turnRate never goes above 1.1:



Anyone know how the keyboard input works for 'on key down' and can explain how this would be done?
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Sat Apr 06, 2013 12:14 am

Well you don't need the top event "on every tick", but that's not the issue there.

If you reproduce your logic there in a brand new capx : like this one it does work as expected.

So obviously the issue is somewhere else in your code where you probably modify "TurnRate" value after this input.

Without seeing your capx, no way to tell, but this simple test confirms that the logic is working and that you're asking the wrong question/looking in the wrong corner.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Sat Apr 06, 2013 1:10 am

I think I figured it out.

turnRate is a local variable, but it wasn't set to Static, so it was being reset constantly.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, jul, nicklowkcmagic and 16 guests