Search code examples
mit-scratch

Sprite disappears in Scratch even when touching another sprite


On my puppy salon project, I have run into a problem when I get to the necklace section. I want all the unused necklaces to disappear when they receive the message m11, but for the one on the puppy to remain. Right now, however, all the necklaces are disappearing.

This is the code that is run when the necklace is assigned to the 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 advanced (this is in an arrow sprite):

when this sprite clicked broadcast m11 hide

This message is received by each necklace:

when I receive m11 hide; if touching Sprite1 then show

My whole project is here.


Solution

  • A sprite cannot sense that it is touching if it is hidden. You'll need to change your script logic - only hide if it's not touching sprite1.

    enter image description here