MaggieLouise
MaggieLouise

Reputation: 41

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.

Upvotes: 3

Views: 2839

Answers (2)

Account_2
Account_2

Reputation: 61

Well, here's a small hint that will probably make you realise your mistake! If all the necklaces are receiving m11 then which necklaces will disappear? Well, still stumped? I will tell you. If all the necklaces are receiving m11 then all of them will disappear! So, you will need to alter the script to make the necklace currently on the dog show, but hide the rest!

Upvotes: -1

Scimonster
Scimonster

Reputation: 33409

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

Upvotes: 6

Related Questions