Update Global Variable and Text

So my games code to update a variable is only working for making it go from 0 to 1. Heres my code


Everything is in the correct scope.
please help

Welcome. Unless it’s cropped on the top. It looks like the first event is setting the score to 0 on every frame because I can’t see any conditions. You could add an at the beginning of the scene condition to the 1st event.

Edit: I see you’re moving the coin. Forget the 2nd part of my reply. I’ll delete that.

1 Like

Thank you very much. It worked :grin:. I thought no condition would mean on the start and not forever. TYSM

1 Like

You’re welcome. An event without any conditions means the actions apply to all of the objects on every frame. I like to think of conditions like filters. They not only check for true or false but they also pick the objects that match them. Then any actions only apply to those objects.

Just a heads up, **at the beginning ** means the beginning of the scene as in the first frame, it still gets processed once by where it is on the event sheet. I usually put them all at the top under one **at the beginning **

1 Like