Toggling on and off a event with the same key

0 favourites
  • 7 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • Hi there guys! here's the deal....i'm trying really hard to toggle a certain even in my project with the same key:

    so here's what i've been doing so far,i've set 3 global variable to the event i want to activate(default one=0,On=1,Off=2)

    if you press the Z key the value is set to 1 and the lerp function is On

    now i would like to use the same key again to set the value to 2(so it can be deactivated)

    what can i do? thank you for you help!

    here's a screenshoot of my event sheet hope it helps!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If your issue has anything to do with both events triggering at once, try putting a simple 'Wait 0.01 seconds' above the other actions. If this isn't your problem, I can't really help you.

  • Nope..the fact is that i would like to trigger an event with the z key(and it remains triggered) and then set it off with the same Key,i'm trying to make a *LOCK-ON* system for targeting enemies,thank you for your help anyways! :3

  • Do you mean trigger it again on release of the button after a certain amount of time?

  • something liket that.i mean like..let's assume i have a button and if i press it the light on my room turns on and if i release it nothing change,than i press it again and the light turns off,this is i would like to do

  • From your screenshot above, you probably want

    Z is pressed, condition (lockon=0) - set lockon to 1

    Z is pressed, condition (lockon=1) - set lockon to 2

    Don't use 'is down' or the key will be down during all variable changes and change the variable from 0 to 2.

    If you actually do want to be able to hold the key down for some reason then you can use 'trigger once'

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