Sprite disappears in Scratch even when touching another sprite

In my salon puppy project, I got a problem when I got to the necklace section. I want all unused necklaces to disappear when they receive the message m11

, but in order to stay on the puppy. Right now, however, all the necklaces are disappearing.

This is the code that runs when a necklace is assigned to a puppy:

when this sprite clicked glide 1 secs to x: -10 y: -5

Which puts it on top of the puppy sprite.

And when the page is promoted (this is in the sprite arrows):

when this sprite clicked broadcast m11 hide

This message is received by every necklace:

when I receive m11 hide;  if touching Sprite1 then show

My whole project is here .

+3


source to share


2 answers


A sprite cannot figure out what it is touching if it is hidden. You will need to change the script logic - only hide if not touching sprite1.



enter image description here

+5


source


Well, here's a little hint that will probably make you realize your mistake! If all necklaces are received m11

, which necklaces will disappear? Well still stumped? I'll tell you. If all necklaces are received m11

, then they will all disappear! So you will need to modify the script to make the necklace currently on display, but hide the rest!



0


source







All Articles