Have a variable increase as a key is held down?

0 favourites
  • 3 posts
From the Asset Store
Includes 11min video guide. Hold an input button to "fill" up a text object and safely skip cutscenes without annoyances
  • The solution is painfully obvious, but it doesn't seem to work.

    <img src="http://i.imgur.com/DuKc2wP.png" border="0" />

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

    <img src="http://i.imgur.com/2jvd2Qw.jpg" border="0" />

    Anyone know how the keyboard input works for 'on key down' and can explain how this would be done?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • I think I figured it out.

    turnRate is a local variable, but it wasn't set to Static, so it was being reset constantly.

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