Discuss Scratch
- Discussion Forums
- » Suggestions
- » Add detection for touching clones of self
- A-no-meep
-
100+ posts
Add detection for touching clones of self
The Scratch team should make the <if touching> boolean so that you can have a sprite detect whether it is touching a clone of itself.
Detection by color could be used if your project was not visual effect heavy, but most of the projects I make I want to be visual effect heavy, i.e. using screen size sprites to have nighttime levels look darker by ghost effects.
Currently, if you have a sprite with a <if touching (name of sprite)> it will always be true.
If you can use a <if touching> boolean to detect clones will help allow games to have visual effects and many colliding boxes.
Detection by color could be used if your project was not visual effect heavy, but most of the projects I make I want to be visual effect heavy, i.e. using screen size sprites to have nighttime levels look darker by ghost effects.
Currently, if you have a sprite with a <if touching (name of sprite)> it will always be true.
If you can use a <if touching> boolean to detect clones will help allow games to have visual effects and many colliding boxes.
- A-no-meep
-
100+ posts
Add detection for touching clones of self
That project does not fill the purpose I want. I need to detect whether a sprite is touching a clone of itself, not telling apart between 3 clones of a different sprite.
- millerchip
-
2 posts
Add detection for touching clones of self
+1 on this request: I want to create a number of clones, and then detect when any 2 clones touch. I have a feeling there's a workaround, but I suspect that detection (within this workaround) will be an order n^2 operation (where n = # of clones).
- ChildCritic
-
500+ posts
Add detection for touching clones of self
Make a separate sprite and create this script:
you now have clone of self detection.
<touching [sprite in question v] ?>and then drag it to the icon on the sprite panel of that sprite.
you now have clone of self detection.
- DaSpudLord
-
1000+ posts
Add detection for touching clones of self
^^^ Make a separate sprite and create this script:<touching [sprite in question v] ?>and then drag it to the icon on the sprite panel of that sprite.
you now have clone of self detection.
However, I still support being able to select the sprite from the dropdown from within that sprite.
- TheLogFather
-
1000+ posts
Add detection for touching clones of self
It'd be possible if we could do this:
But, as shown above, we could hide it first, and then check if it is touching any of its clones.
Unfortunately, we also can't do that because the *one thing* that a hidden sprite/clone can't detect is touching other (non-hidden) sprites/clones.
See here for a demo of this odd inconsistency: https://scratch-mit-edu.ezproxyberklee.flo.org/projects/56442484/
hideWhen ‘Sprite1’ is showing it always gives “true” for ‘touching Sprite1’, so it's no good just checking if touching itself.
if < touching [Sprite1 v]> then // "Sprite1" is name of itself
...
end
show
But, as shown above, we could hide it first, and then check if it is touching any of its clones.
Unfortunately, we also can't do that because the *one thing* that a hidden sprite/clone can't detect is touching other (non-hidden) sprites/clones.

See here for a demo of this odd inconsistency: https://scratch-mit-edu.ezproxyberklee.flo.org/projects/56442484/
Last edited by TheLogFather (Jan. 1, 2016 17:23:29)
- millerchip
-
2 posts
Add detection for touching clones of self
I think I've created a project that does what I want: it's not perfect, but it seems to work.
https://scratch-mit-edu.ezproxyberklee.flo.org/projects/92827970/
https://scratch-mit-edu.ezproxyberklee.flo.org/projects/92827970/
- calulord
-
100+ posts
Add detection for touching clones of self
My idea for a feature on scratch is that If in the program a clone of a sprite can be created then in blocks where you pick a sprite (for example “the touching sprite” sensor block) you can select “Clone of (sprite name)” Here is what is might look like.
<touching [Clone of sprite1 v] ?>
- jromagnoli
-
1000+ posts
Add detection for touching clones of self
Duplicate suggestion, I'll try to find the link.
- TheLogFather
-
1000+ posts
Add detection for touching clones of self
Presumably that will be true if touching *any* clone of sprite1, right?<touching [Clone of sprite1 v] ?>
So how is it different to the current “touching sprite1?” block (which is also true if touching any clone of sprite1)?
Does it give false if it's touching the *original* sprite? Even if so, I can't say I see that much use for it…

Otherwise, what does it give that the current “touching sprite1?” does not give?
The only thing I can see that would be useful would be a way to target a *specific* clone (e.g. “touching clone# 3 of sprite1?”) – but it's way too difficult to find a good & intuitive way to reference specific clones like this.
Last edited by TheLogFather (Feb. 25, 2017 16:55:21)
- calulord
-
100+ posts
Add detection for touching clones of self
Presumably that will be true if touching *any* clone of sprite1, right?<touching [Clone of sprite1 v] ?>
So how is it different to the current “touching sprite1?” block (which is also true if touching any clone of sprite1)?
Does it give false if it's touching the *original* sprite? Even if so, I can't say I see that much use for it…
Otherwise, what does it give that the current “touching sprite1?” does not give?
The only thing I can see that would be useful would be a way to target a *specific* clone (e.g. “touching clone# 3 of sprite1?”) – but it's way too difficult to find a good & intuitive way to reference specific clones like this.
You seriously can't come up with a good use for this.
- WolfCat67
-
1000+ posts
Add detection for touching clones of self
The current “touching” blocks also work with clones, and you can detect them if you have a “this-sprite-only” variable on the sprite you want to touch, plus some broadcasts. Workarounds, and also there isn't really too much of a use for it…Presumably that will be true if touching *any* clone of sprite1, right?<touching [Clone of sprite1 v] ?>
So how is it different to the current “touching sprite1?” block (which is also true if touching any clone of sprite1)?
Does it give false if it's touching the *original* sprite? Even if so, I can't say I see that much use for it…
Otherwise, what does it give that the current “touching sprite1?” does not give?
The only thing I can see that would be useful would be a way to target a *specific* clone (e.g. “touching clone# 3 of sprite1?”) – but it's way too difficult to find a good & intuitive way to reference specific clones like this.
You seriously can't come up with a good use for this.
- alexphan
-
1000+ posts
Add detection for touching clones of self
Well, you haven't listed any examples of how this block would be useful, so maybe that will help?Presumably that will be true if touching *any* clone of sprite1, right?<touching [Clone of sprite1 v] ?>
So how is it different to the current “touching sprite1?” block (which is also true if touching any clone of sprite1)?
Does it give false if it's touching the *original* sprite? Even if so, I can't say I see that much use for it…
Otherwise, what does it give that the current “touching sprite1?” does not give?
The only thing I can see that would be useful would be a way to target a *specific* clone (e.g. “touching clone# 3 of sprite1?”) – but it's way too difficult to find a good & intuitive way to reference specific clones like this.
You seriously can't come up with a good use for this.
- calulord
-
100+ posts
Add detection for touching clones of self
The current “touching” blocks also work with clones, and you can detect them if you have a “this-sprite-only” variable on the sprite you want to touch, plus some broadcasts. Workarounds, and also there isn't really too much of a use for it…Presumably that will be true if touching *any* clone of sprite1, right?<touching [Clone of sprite1 v] ?>
So how is it different to the current “touching sprite1?” block (which is also true if touching any clone of sprite1)?
Does it give false if it's touching the *original* sprite? Even if so, I can't say I see that much use for it…
Otherwise, what does it give that the current “touching sprite1?” does not give?
The only thing I can see that would be useful would be a way to target a *specific* clone (e.g. “touching clone# 3 of sprite1?”) – but it's way too difficult to find a good & intuitive way to reference specific clones like this.
You seriously can't come up with a good use for this.
1- I tried It and it didn't work.
Well, you haven't listed any examples of how this block would be useful, so maybe that will help?Presumably that will be true if touching *any* clone of sprite1, right?<touching [Clone of sprite1 v] ?>
So how is it different to the current “touching sprite1?” block (which is also true if touching any clone of sprite1)?
Does it give false if it's touching the *original* sprite? Even if so, I can't say I see that much use for it…
Otherwise, what does it give that the current “touching sprite1?” does not give?
The only thing I can see that would be useful would be a way to target a *specific* clone (e.g. “touching clone# 3 of sprite1?”) – but it's way too difficult to find a good & intuitive way to reference specific clones like this.
You seriously can't come up with a good use for this.
Okay here is an example, you are making a game and you want to have something do something only when they are touching some bad guy, but here is the problem: the sprite would not know if it was touching a clone and you used clones to create the bad guys. This is where the touching clone block would come in.
- duckboycool
-
1000+ posts
Add detection for touching clones of self
The current block we have would work for that situation. Are you making sure you are setting it to the correct sprite?
- calulord
-
100+ posts
Add detection for touching clones of self
That could work but there is no way for the clones to know if none of them are touching and to set it to false has fas as I can figure out. The current block we have would work for that situation. Are you making sure you are setting it to the correct sprite?
- duckboycool
-
1000+ posts
Add detection for touching clones of self
if <touching [bad guy v] ?> thenThat would work. Is there something else I don't know about?
...
end
- calulord
-
100+ posts
Add detection for touching clones of self
Okay thanks!if <touching [bad guy v] ?> thenThat would work. Is there something else I don't know about?
...
end

- calulord
-
100+ posts
Add detection for touching clones of self
Okay thanks!if <touching [bad guy v] ?> thenThat would work. Is there something else I don't know about?
...
end
Wait I forgot, That only tell the clone that it's young something not what's it's touching.
- Discussion Forums
- » Suggestions
-
» Add detection for touching clones of self