Events not working in APK build (collecting coins and unlocking skin)

Hello,

new day new problem. I have installed skins in my game, in game mode you can collect coins and unlock these skins.

I have now made a sprite that has a gray background for the skin, and the skin should only be unlockable and playable once you have collected a number of coins.

My problem here, short and sweet. I can ALWAYS play the skin, even if I haven’t collected any coins.

Can someone help me again?

Hi,
the event blocks work for most cases as an if-then process. If the ‘cursor/touch on pinkskinlocked’ and ‘left mouse button down’, then do everything that is on the right side (the actions). Both conditions have to be met to trigger the actions (they will be executed one after another from the first line down to the last).

So in your first block, you have a condition ‘Coins is equal or bigger than 100’ which is important for unlocking the skin, but then there is no action in the block.
You can fix that by just taking the condition of the first event block and putting it in the second. Then only if the player has 100 or more coins plus the cursor and click conditon are true, the pinkskin will be unlocked.

Well, I tried it. Maybe I misunderstood it, but it still doesn’t work. Can you give me an example screenshot?

This is what I changed

Okay, could you explain what isn’t working for you in these events?

When i make the APK on my Phone, i can Play with the Skin without collecting any Coins. The Skin is instantly free

Alright, assuming that you are using the desktop or web version of Gdevelop, if you preview the scene on your desktop everything works as intended?

Yes on my PC is already fine

Unfortunately, I cannot help you with that. The problem based on the initial screenshot that you have posted is solved but obviously that’s only one part and the main issue is now with the APK. I hope someone else can chime in and suggest something to fix the problem. (I will change the title of this topic as at the moment it is not really clear what the problem is).

I may know the solution, it works all fine but you already unlocked it did you not? Since it says u saved the variable in storage, i’m guessing you already loaded it in the beginning. So, it should work just fine for other people.

Hope this helps!

No Not really, on my Smartphone i dont have unlock the Skins. Only on my PC


it seems to me that you have already written the variable () and it does not change.
Make a button to reset the entire storage, complete the level before receiving and take a look.
For convenience, output a variable in the text - for visual perception of the triggering of your actions.

Oh Yes, that works. Thank you so much