0 Favourites

On Control released

This forum is currently in read-only mode.
  • Either I don't quite get it or it'd make a lot of sense to add this condition to Construct. There is a 'on control pressed' condition, but no 'on control released condition. Curiously, there's both a 'on key pressed' and a 'on key released' condition.

    For example, I'm currently working on a charge beam thingy, so if you hold the button you add a value to a pv, if you release the button the player fires and the clamped value sets itself back to 0.

    So, what would be the quickest way to set this up without having a 'on control released' condition?

  • ControlState is either on or off, 1 or 0

    + System: MouseKeyboard.ControlState("Move Left", 1) Equal to 0

    ->do stuff

  • I'm not sure that that helps - I want to define an action in the exact moment when I release a button.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I'm not sure that that helps - I want to define an action in the exact moment when I release a button.

    That shouldn't be hard to implement. You just save the current state you're interested in. I haven't worked with control state, but I don't see, why it shouldn't work:

    Start of layout

    ->SomeVar = "Released"

    System: MouseKeyboard.ControlState("Move Left", 1) Equal to 1

    SomeVar Equal to "Released"

    ->SomeVar = "Pressed"

    System: MouseKeyboard.ControlState("Move Left", 1) Equal to 0

    SomeVar Equal to "Pressed"

    ->SomeVar = "Released"

    ->do stuff

    (Maybe 'trigger once' will do as well instead)

  • In your case it's really easy to do.

    +charge is greater then 0

    +NOT! key is down

    -> blast everyone

    -> set charge to 0

  • It would be better if this was in the same place as "On Control Pressed" rather than having some funky workaround that I'm not sure how to use anyway.

    +1 to the request. The buffer for my fighting game needs this particular feature.

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