[SOLVED] Button that activates another object's tween not working

Hello
I was trying to recreate that FNaF 6 Salvage minigame, to test my coding.
I haven’t even started and already found 1 problem, the button is not working:


Basically, what is supposed to happen is:
You click on the button, if the document is on screen, then tween the object’s Y position to the center of the screen.
If not, then tween the object’s Y position to the bottom, off-screen.
(Some extra context if needed:
The frame changing thing is for when the object’s moving: frame 1 = blurry document; frame 2 = document with no blur)

In your first sub event when docuiment.onScreen = 0, you set document,onScreen to 1, and in the subevent immediately after, the condition is true, so the event is actioned.

If onScreen is only ever 0 or 1, I’d suggest using a boolean rather than a number, and toggling the value to avoid this trap :

1 Like