Won't next on first try

help
The block works. But I have to click twice on the first try for the image to change to the next one

Those blocks should work. Can you post a link to your project?

Edit: you’re starting with the index at 0 so when the user clicks the button, it changes to 1. But the default image for the skin is index 1 (skin1.png). So it just looks the same whether the index is 0 or 1. Then when you click again, index is 2 (skin2.png) and the skin looks different.

You need to initialize index to 1.

I already tried that and it’s still the same thing

This is really strange. When I set up these blocks to check the value of the index variable, the screen shows 0 when the screen opens. It should show 1.

By the way, I recommend using different naming conventions. For example, skinIndex or skin_Index instead of index; hairIndex instead of index1; etc.

Edit: This works:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.