Problem with score in Geometry Monster Tutorial

Hi, I just installed GDevelop and I am doing the Geometry Monster tutorial but I have a problem with step 8. I added the action to add 1 to the score every time the monster hits a shape and then update the text with the variable. It lookes like this:

But the Score always shows 0. The condition triggers, the sound is played and the shape is destroyed. Why isn’t the score variable raised by one?

Place your “modify a text” action in a separate event with no condition.
And i think your condition in the screenshot above should have a “trigger once” condition

Doesn’t work either.

And just out of curiosity: Why should it work this way but not the other?

Can i get a larger screen shot of events

Make the actions you have filled in the condition " shapes is in collision with monster" a sub condition. Therefore they would be no condition in the sub condition you created

Like this?

Still doesn’t work.

I really don’t understand why it is not working. Initially the text is just "Score: ". Once the monster hits a shape the text switches to “Score: 0”, so the line that refreshes the text works. Only adding 1 to the variable does not work.

I even tried to add the action the condition that moves the monster so the score is increased by every press on the left cursor. Still the score is showed as 0. I think either I’m showing the wrong variable or I’m adding to the wrong variable. But I don’t see where the error is.

Edit: I got it. It’s the " around Score in the line that adds 1 to the variable.

1 Like

The quote is used for text. :slight_smile:

Shouldn’t this give an error? It is not possible to reference a variable that is named “Score”, so why is it possible to enter it as a name?

Nope .
As far as i know variables are not written in between quotes

Yes. I understand that they are not written between quotes. I just wonder why it is allowed.