Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to make scratch sprites be able to be clicked behind other sprites
- RogerLemon
-
6 posts
How to make scratch sprites be able to be clicked behind other sprites
So, I have one sprite as a light (ghost effect) with other sprites behind it. When you try to click the sprite behind it, it will act like you are clicking the light sprite. How would I make the sprites behind the light clickable, without making them in front of the light?
- Cool_Dude2022
-
500+ posts
How to make scratch sprites be able to be clicked behind other sprites
So, I have one sprite as a light (ghost effect) with other sprites behind it. When you try to click the sprite behind it, it will act like you are clicking the light sprite. How would I make the sprites behind the light clickable, without making them in front of the light?
Instead of detecting if the mouse is touching it, detect if the mouse is inside the hitbox instead.
- YC72909
-
100+ posts
How to make scratch sprites be able to be clicked behind other sprites
Hello!
I think you could make another sprite or clone (you can choose which one works best for you) that is exactly the same as the sprite behind the light sprite. Bring that sprite to the front layer, hide it, and add click sensing. You could send a broadcast message to the real sprite behind the light sprite and make it do whatever you intended it to do.
So, in the copy of the sprite you're trying to click without bringing it in front of the light sprite, your script might look something like this:
Hopefully this helps
I think you could make another sprite or clone (you can choose which one works best for you) that is exactly the same as the sprite behind the light sprite. Bring that sprite to the front layer, hide it, and add click sensing. You could send a broadcast message to the real sprite behind the light sprite and make it do whatever you intended it to do.
So, in the copy of the sprite you're trying to click without bringing it in front of the light sprite, your script might look something like this:
Hopefully this helps

- RogerLemon
-
6 posts
How to make scratch sprites be able to be clicked behind other sprites
Thanks.So, I have one sprite as a light (ghost effect) with other sprites behind it. When you try to click the sprite behind it, it will act like you are clicking the light sprite. How would I make the sprites behind the light clickable, without making them in front of the light?
Instead of detecting if the mouse is touching it, detect if the mouse is inside the hitbox instead.
- Discussion Forums
- » Help with Scripts
-
» How to make scratch sprites be able to be clicked behind other sprites