Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do i make something happen when one sprite TOUCHES another
- ArianaCampbell
-
Scratcher
4 posts
How do i make something happen when one sprite TOUCHES another
I know how to make something happen when two sprites are constantly touching, but how do i make something happen when they touch ONCE?
- ItBeJC
-
Scratcher
1000+ posts
How do i make something happen when one sprite TOUCHES another
I'm not sure what you mean exactly, but maybe something like this:
wait until <touching [sprite v] ?>If you want this to happen all of the time, just put a forever loop around it.
wait until <not <touching [Sprite v] ?>>
... // Runs the scripts you want to run when the sprites touch.
- deck26
-
Scratcher
1000+ posts
How do i make something happen when one sprite TOUCHES another
Do you mean they only touch once? You could do a wait until touching and then add the code (perhaps a broadcast) to make something happen.
- cookieclickerer33
-
Scratcher
1000+ posts
How do i make something happen when one sprite TOUCHES another
If you want an “easy” and quick way to do it there’s always
https://scratch.mit.edu/projects/916397939/
when this sprite touches [mouse pointer v]::events hat
https://scratch.mit.edu/projects/916397939/
- ArianaCampbell
-
Scratcher
4 posts
How do i make something happen when one sprite TOUCHES another
I mean like if you want the message “you died” to pop up after a sprite touches another sprite. I tried to do it with the when touching command but that makes it to where the message constantly glitches.
- amogus1123
-
Scratcher
500+ posts
How do i make something happen when one sprite TOUCHES another
I mean like if you want the message “you died” to pop up after a sprite touches another sprite. I tried to do it with the when touching command but that makes it to where the message constantly glitches.example: https://scratch.mit.edu/projects/916446405/
i replicated what you said, it works fine.
- amogus1123
-
Scratcher
500+ posts
How do i make something happen when one sprite TOUCHES another
Please make constructive posts.
- scratchcat_0001
-
Scratcher
3 posts
How do i make something happen when one sprite TOUCHES another
I mean like if you want the message “you died” to pop up after a sprite touches another sprite. I tried to do it with the when touching command but that makes it to where the message constantly glitches.maybe add a stop this script block?
when green flag clicked
forever
if <touching(v)> then
something
stop [ this script]
Last edited by scratchcat_0001 (Oct. 31, 2023 09:14:52)
- Master_-_Of_-_Code
-
Scratcher
7 posts
How do i make something happen when one sprite TOUCHES another
I know how to make something happen when two sprites are constantly touching, but how do i make something happen when they touch ONCE?Here's how I would do it:
wait until <touching [THE OTHER SPRITE v] ?>ALSO I DO NOT HAVE 6 POSTS!
wait until <not <touching [THE OTHER SPRITE v] ?>>
do something
Last edited by Master_-_Of_-_Code (Oct. 30, 2023 22:04:20)
- amogus1123
-
Scratcher
500+ posts
How do i make something happen when one sprite TOUCHES another
I know how to make something happen when two sprites are constantly touching, but how do i make something happen when they touch ONCE?Here's how I would do it:wait until <touching [THE OTHER SPRITE v] ?>ALSO I DO NOT HAVE 6 POSTS!
wait until <not <touching [THE OTHER SPRITE v] ?>>
do something
This is the exact same as #2…
- mixingbutterso
-
Scratcher
2 posts
How do i make something happen when one sprite TOUCHES another
aaa why is all things here like this was made in 2012 theres no wait until what do i do
aaaaaaaaaaa
aaaaaaaaaaa

- mixingbutterso
-
Scratcher
2 posts
How do i make something happen when one sprite TOUCHES another
and everything else doesnt make sense!!!
- CoolBanana019
-
New Scratcher
2 posts
How do i make something happen when one sprite TOUCHES another
#West_Virginia4life
can you make the message you died come up when 1 sprite touches another using REAL CODE PLEASE!!!!!!
#mad
#new_scracher
#not_a_code_master
can you make the message you died come up when 1 sprite touches another using REAL CODE PLEASE!!!!!!
#mad
#new_scracher
#not_a_code_master
- CoolBanana019
-
New Scratcher
2 posts
How do i make something happen when one sprite TOUCHES another
WELLLLL?
#imPATIANT
#imPATIANT
- BigNate469
-
Scratcher
1000+ posts
How do i make something happen when one sprite TOUCHES another
#West_Virginia4life
can you make the message you died come up when 1 sprite touches another using REAL CODE PLEASE!!!!!!
#mad
#new_scracher
#not_a_code_master
WELLLLL?Please don't necropost. The people who responded to this probably haven't been looking at this for several months. Open your own topic instead.
#imPATIANT
Also, don't be rude. And, using the octothorpe (better known as a hashtag) to write #______ with off-topic things can be considered spam if it isn't in a signature.
- LearnerYetCoder
-
Scratcher
10 posts
How do i make something happen when one sprite TOUCHES another
Maybe this?
In the other sprite:
when flag clicked
set [touching other sprite v] to [false]
wait until <touching (other sprite v)?>
set [touching other sprite v] to [true]
broadcast (touching v) // to other sprite only
stop [this script v] // not really needed but meh
In the other sprite:
when I receive [touching v] // only in the wanted sprite
if <(touching) = [true]> then
...
set [touching other sprite v] to [false]
end
- LearnerYetCoder
-
Scratcher
10 posts
How do i make something happen when one sprite TOUCHES another
(touching) = (touching other sprite) * :: grey reporter
Just correcting the touching variable.- dragonsnake003
-
Scratcher
100+ posts
How do i make something happen when one sprite TOUCHES another
I mean like if you want the message “you died” to pop up after a sprite touches another sprite. I tried to do it with the when touching command but that makes it to where the message constantly glitches.
wait until <touching [ v] ?>
broadcast [YOU DIED v]
- RicDiamond1477
-
Scratcher
100+ posts
How do i make something happen when one sprite TOUCHES another
what you make no sensPlease don't post on discussions made and resolved a long time ago, this is called necropsying and redirects Scratchers from other Scratchers needing help.
- Discussion Forums
- » Help with Scripts
-
» How do i make something happen when one sprite TOUCHES another















