Discuss Scratch

-L0VELY_WRECK-
Scratcher
5 posts

I'm making a character creator and can't seem to spot the issue. Help?

So basically, I have a separate sprite for a button that leads to male eyes and another for female eyes. When I test out the game, I press whatever gender option I want for the base. Once I do this, I can click the sprite button for male eyes just fine and it allows me to choose from the male options as I need. But the moment I press the back button I made, I can play the game normally other than the eyes button. When I click it after (and only after) the back button is pressed, the male eyes option somehow gets switched to the female eyes option. I suspect there might be something wrong with the back button since the issue only occurs after pressing it.
Now, I would just have the male and female eyes be in the same section, but the base models are different heights and in different poses, so it won't really work.
I don't know if I explained this well or not, so sorry if it makes absolutely no sense. I can share the project for someone to look inside in case they need to.
legendary34678
Scratcher
1000+ posts

I'm making a character creator and can't seem to spot the issue. Help?

Can you please post the link to your project so that we can take a look at the code? Thanks!
-L0VELY_WRECK-
Scratcher
5 posts

I'm making a character creator and can't seem to spot the issue. Help?

Yeah. Here's the link.https://scratch.mit.edu/projects/1138595973
Thanks for being willing to help!
imfh
Scratcher
1000+ posts

I'm making a character creator and can't seem to spot the issue. Help?

Looking at your code, it looks like you have this script in both your female eyes button sprite and the male eyes button sprite:

whenIreceiveBACKshow

The problem with this is that both buttons get shown when the back button is clicked. The female eyes button happens to be on top, so after clicking the back button, that is always what will show.

To fix the problem, I would try using a variable. Variables can be used to store information for later use. It looks like you already have tried using a variable a little bit. Here is how I would do it:

whenthisspriteclicked In the male button spritesetgendertomalehidebroadcast...whenthisspriteclicked In the female button spritesetgendertofemalehidebroadcast...whenthisspriteclicked In the eyes sprite, you only need onehidebroadcastEyes MenuwhenIreceiveEyes Menu In each female eye optionifgender=femalethenshowwhenIreceiveEyes Menu In each male eye optionifgender=malethenshow

Also, you don't have to do this, but you could change your broadcasts a little bit to make it easier to make your project. Instead of making each sprite receive every possible broadcast and hide, create a new “hide buttons” broadcast. Then, make a “show menu” broadcast for each menu you need.

whenthisspriteclicked Example, in the male/female buttonsetgendertomalebroadcasthide buttons Hide everything firstbroadcastshow main menu Show the needed ones nextwhenthisspriteclicked Example, in the back buttonbroadcasthide buttons Hide everything firstbroadcastshow main menu Show the needed ones nextwhenIreceivehide buttons Put this in every button spritehidewhenIreceivemain menu Put this in every main menu sprite, e.g. eyes, shoesshow
-L0VELY_WRECK-
Scratcher
5 posts

I'm making a character creator and can't seem to spot the issue. Help?

I see. Thanks so much! I appreciate it

Powered by DjangoBB