Discuss Scratch

kerbeus2
Scratcher
15 posts

Clones aren't recieving messages

Hi! I'm working on a text engine, and using broadcast blocks to clear the text, like this:

when I receive [DELETE TEXT]
delete this clone

I haven't had any issues with this method for as long as I've been using it, but for some reason, it seems like the clones simply aren't recieving the message to delete text. I tested with say and wait blocks (shown below), and it confirmed my suspicions. Is anybody else encountering this, and how could I work around it?

when I receive [DELETE TEXT]
say [Hello!] for [2] seconds
wait [1] seconds
delete this clone

Last edited by kerbeus2 (April 20, 2026 20:32:10)

PoggiesDoesGames
Scratcher
68 posts

Clones aren't recieving messages

kerbeus2 wrote:

Hi! I'm working on a text engine, and using broadcast blocks to clear the text, like this:

when I receive [DELETE TEXT]
delete this clone

I haven't had any issues with this method for as long as I've been using it, but for some reason, it seems like the clones simply aren't recieving the message to delete text. I tested with say and wait blocks (shown below), and it confirmed my suspicions. Is anybody else encountering this, and how could I work around it?

when I receive [DELETE TEXT]
say [Hello!] for [2] seconds
wait [1] seconds
delete this clone

It seems that its making the original sprite say the “hello”, and then deleting a random clone.
kerbeus2
Scratcher
15 posts

Clones aren't recieving messages

PoggiesDoesGames wrote:

It seems that its making the original sprite say the “hello”, and then deleting a random clone.

Broadcasts should also go to clones
deck26
Scratcher
1000+ posts

Clones aren't recieving messages

If you share the project you have more chance of getting a quick answer.
Sponge_Bro
Scratcher
64 posts

Clones aren't recieving messages

I don't think using a
delete this clone
block under a broadcast block will do anything. If you still want to use a broadcast block, try this.
Get a broadcast hat from Events (When I Recieve (—)), make a variable (Call the variable what you want to), then under the " When I start a clone block in your workspace, get a forever loop, get an if statement, get an equal block in Operators < (–) = (–) >, put the variable on the left side and on the right bubble, type 1, put that operator block inside the if statement, then get a Delete This Clone block and put it inside that if statement. (Don't forget to add a when green flag clicked than set the variable to 0 so it resets.)

when I receive [Delete Text v]
set [Delete Text v] to [1]

when I start as a clone
forever
if <(Delete Text) = [1]> then
delete this clone
end
end
Sponge_Bro
Scratcher
64 posts

Clones aren't recieving messages

Also this
when green flag clicked
set [Delete Text v] to [0]
deck26
Scratcher
1000+ posts

Clones aren't recieving messages

No reason why a broadcast receiver can't run a ‘delete this clone’ block - I've just done a quick test and it currently works as expected. @Sponge_Bro's solution shouldn't be necessary.
THEIMPORTANT
Scratcher
500+ posts

Clones aren't recieving messages

@deck26 is absoloutely right. When you run “When I recieve —”. The message is recieved for both the original sprite and its clones.
Hammykat-_-
Scratcher
64 posts

Clones aren't recieving messages

If you don't want the main sprite to run it, use a 'for this sprite varaible and set it to something different for the clones, and use a condition. Also you could use variables and a condition as they are more reliable than broadcasts
deck26
Scratcher
1000+ posts

Clones aren't recieving messages

Hammykat-_- wrote:

If you don't want the main sprite to run it, use a 'for this sprite varaible and set it to something different for the clones, and use a condition. Also you could use variables and a condition as they are more reliable than broadcasts
In what way more reliable? The method you suggests ends to mean you have forever loops running just to check the value of a variable (which is inefficient coding) whereas a broadcast, if used properly, only requires code to run as and when required. The main problem people have with broadcasts is putting them in loops so the receivers get restarted rather than running to completion.

Last edited by deck26 (April 21, 2026 12:41:18)

kerbeus2
Scratcher
15 posts

Clones aren't recieving messages

So, from what is being said, it literally just depends on luck to have it work? Man, first the dark blocks and now broadcasts literally not working. I ended up using this method for those interested:

define Text Engine
set [currently typing v] to [1]
Typing stuff
set [currently typing v] to [0]
wait until <not<key [z v] pressed>>
wait until <key [z v] pressed>
wait until <not<key [z v] pressed>>

when I start as a clone
wait until <(currently typing) = [0]>
wait until <not<key [z v] pressed>>
wait until <key [z v] pressed>
wait until <not<key [z v] pressed>>
Hammykat-_-
Scratcher
64 posts

Clones aren't recieving messages

Good compromise! that should work!

Powered by DjangoBB