Help finding event error

Hi. Doing point and click. Want to turn projector on and off. Have 2 titled sprits “i” (when it’s off) and “proj_on”, “i” is the backgournd. With the events as is, it doesn’t turn on. If i delete the last line the projector turns on, but doesn’t turn off (obviously). Can you help me understand why it doesn’t work as is? Thank you.

Try doing Trigger Once condition on the events with the Left Mouse

thank you. like this? Did not work

Did you try moving Trigger Once to the bottom?

If that doesn’t work, you could try Trigger Once at the bottom of these too

Also you don’t necessarily need the “Show proj.on” as a separate event. You could put that into the Left Mouse event, at the top.

And if you put “Hide proj.on” At the beginning of the Scene] you could just have that in the Left Mouse event too.

yes, moved it everywhere, subevents and stuff

like this? still no

When you disable the last event does it still turn projector on?

Try Trigger Once right at the bottom after the Left mouse released

No, i was curious about that too.

yes moved, still no

oh wait it does turn on

but if i enable then it doesn’t

Ok change Left Mouse Released to Left Mouse Down only on the last event.

by down you mean “press or touch held”? yes it works, but only turns off when it’s held

That’s what it says in my version of GD … if that doesn’t work I can think of a different solution…

you are right it says that in the events, i was looking at the full list of conditions, where it says what i said, so it’s the same. only turns off when it’s held

What happens if you remove the Trigger Once from the last event?

only turns off when it’s held

Not sure why it’s not working, it seems like it should but I’m probably missing something. Try moving the Hide and Show actions to the top of the list (before changing variables) and see if that does anything.

If that doesn’t work, one way around it I think is to place a timer instead of changing the global variable back to 0 straight away. You could try…

Action: Reset timer “switchoff” (example timer name) instead of putting the global variable there.

(Also try with Left Mouse Released if Left Mouse Down doesn’t work this time)

Then in a separate event below have something like

Condition: Timer “switchoff” is greater than 2 seconds (or however long you want the delay)
Action: Change variable projector set 0
Action: Pause timer “switchoff”

(You might also need to reset and pause the timer right At the Beginning of the Scene for it to work properly)

Like this? it turns on but doesn’t turn off. if i put “hide proj_on” on the event above it doesn’t turn on even.

i think you need to put Trigger Once at the end otherwise when Left mouse is released it will keep resetting the timer (on every frame) and never reach 1 second. You could put Hide at the top of this event too so it should turn off as soon as you press the switch.

Then it should delay for a second before it changes the variable to 0, which means it shouldnt trigger the previous light on switch (at least not straight away)

same. it turns on but doesn’t turn off. if i put “hide proj_on” on the event above it doesn’t turn on even

If you’re ok to upload your project folder, I’ll take a look… You can link here or dm me the link