Hi, I’m new to gdevelop and have little programming knowledge. I have created a global variable which stores the score. I need a condition for an event to occur at every particular score. Like when I have a score multiples of 5(5,10,15,20…), I need to execute the event. How to make the condition. Please help
if global variable score = 10 then
show win
I think this will happen only at score=10. I need the action to happen at multiple instances of score. Like 5,10,15,20…
then search for or in the condition after that
if global variable score = 10
if global variable score = 15…
But I can’t type like 100 lines. I need a condition like a modulus operator to check mod(score,5) is equal to 0, then execute action.
I don’t think it’s that simple :
- If the score doesn’t change, it’ll fire every single frame. Do you want that to happen?
- If you put a trigger once in there, then it won’t fire if the score changes from one multiple of 5 to another. Can this scenario occur? If so, is this what you want to happen?
1 Like
he could use a seconday check variable.
like if mod(score,5)=0
→ if score != variable check → do action and then set variable check to variable score.
3 Likes
Maybe like this
1 Like