Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Touching block not working
- ObscureSeafood
-
Scratcher
14 posts
Touching block not working
I'm trying to make a game where these two blocks have to touch a separate checkpoint which I've made using clones. They were working before but not sure what I did as they are no longer working.
Here is my project: https://scratch.mit.edu/projects/749587057/
Go to checkpoint sprite to see the code for it
Here is my project: https://scratch.mit.edu/projects/749587057/
Go to checkpoint sprite to see the code for it
Last edited by ObscureSeafood (Oct. 22, 2022 21:58:28)
- Oumuamua
-
Scratcher
1000+ posts
Touching block not working
How many clones you want to create? i'm asking because you are creatin up to 18 in less than a second…
See the picture and think about.

See the picture and think about.

- ObscureSeafood
-
Scratcher
14 posts
Touching block not working
Thanks for the reply, uhh I'm gonna need at least 2 clones for each of the characters to pass a new level.
- ObscureSeafood
-
Scratcher
14 posts
Touching block not working
I'm so confused why this isn't working I remember it working perfectly fine but then I was trying to change the positions of the checkpoints and something happened.
Edit: Sorry if I'm coming off as rude but I am really desperate for this to work. It was just working before as well which makes it even worse.
Edit: Sorry if I'm coming off as rude but I am really desperate for this to work. It was just working before as well which makes it even worse.
Last edited by ObscureSeafood (Oct. 22, 2022 11:14:54)
- deck26
-
Scratcher
1000+ posts
Touching block not working
I suspect you have an ‘and’ where you should have an ‘or’. Touching one of the players is what you want rather than having to touch both?
- ObscureSeafood
-
Scratcher
14 posts
Touching block not working
No I want to have one checkpoint touching each one of the players simultaneously to start a new level. So both I think. The problem seems to be code not detecting one of the clones but only the original block.
Edit: The only fix I've found so far is to overlap the checkpoints point. But I want a more effective solution. For some reasons my clones are no longer being deleted as well.
Edit: The only fix I've found so far is to overlap the checkpoints point. But I want a more effective solution. For some reasons my clones are no longer being deleted as well.
Last edited by ObscureSeafood (Oct. 22, 2022 22:50:19)
- ObscureSeafood
-
Scratcher
14 posts
Touching block not working
I found out my clones are being multiplied by alot because I'm using a broadcast command to create clones. Is there a way to only have one clone each created?
- legendary34678
-
Scratcher
1000+ posts
Touching block not working
1. Remote Broadcasting - Use another sprite that doesn't have clones to receive the broadcast message. Or, use the backdrop.
2. Clone ID - Use an ID variable to detect if the thing that received the message is a clone or a sprite
when I receive [make clones v]
create clone of [sprite v] //Click "myself" and then select the name of the sprite
2. Clone ID - Use an ID variable to detect if the thing that received the message is a clone or a sprite
when green flag clicked //When you initially create the first clones
set [Clone ID v] to [Clone] //For this sprite only
create clone of [myself v]
set [Clone ID v] to [Sprite]
when I receive [make clones v]
if <(Clone ID) = [Sprite]> then
set [Clone ID v] to [Clone]
create clone of [myself v]
set [Clone ID v] to [Sprite]
end
- ObscureSeafood
-
Scratcher
14 posts
Touching block not working
https://media.discordapp.net/attachments/931843487085772824/1033560655858507857/unknown.png?width=863&height=671 is that how you do it? And
how do you position where the clones will go?
how do you position where the clones will go?
Last edited by ObscureSeafood (Oct. 23, 2022 02:05:35)
- legendary34678
-
Scratcher
1000+ posts
Touching block not working
You can't just add in the scripts I put into your project and expect it to work. I just provided an example. You would have to set Clone ID to Clone before you use the “create clone of myself” block and then set it back to sprite at the end of all of your cloning scripts. I'm not sure why you have a forever loop for the “when I receive Start” block, but that probably shouldn't be there. Also, add the if loop for all other broadcasts with a “create clone of myself” block under it to check if Clone ID = Sprite to make sure that only the sprite is running that code.
- ObscureSeafood
-
Scratcher
14 posts
Touching block not working
Nvm, I got it working thanks so much.
Last edited by ObscureSeafood (Oct. 23, 2022 09:08:27)
- ObscureSeafood
-
Scratcher
14 posts
Touching block not working
Also is there a way to delete the clones after a new level. Nvm I got it too work. Thanks everybody for the help.
Last edited by ObscureSeafood (Oct. 23, 2022 10:17:22)
- pokeprooo
-
Scratcher
13 posts
Touching block not working
I'm trying to make a game where these two blocks have to touch a separate checkpoint which I've made using clones. They were working before but not sure what I did as they are no longer working.mine too!
Here is my project: https://scratch.mit.edu/projects/749587057/
Go to checkpoint sprite to see the code for it
- Nibblet_A
-
Scratcher
3 posts
Touching block not working
My project, the blocks are not working too, so I have been making it so when you press a key, that it responds, but some of the key responding blocks are not working, like, the player is not working when I press WASD. I don't know why. or how this became to be.
There/Here is the link for the project. https://scratch.mit.edu/projects/946453124/
There/Here is the link for the project. https://scratch.mit.edu/projects/946453124/
- HelloReset
-
New Scratcher
1 post
Touching block not working
why isnt mine working also if you want to do the WASD then do the makey makey tool.
- BigNate469
-
Scratcher
1000+ posts
Touching block not working
Please don't necropost.
Necroposting is when you post in an old topic
Reporting this thread to be closed
Necroposting is when you post in an old topic
Reporting this thread to be closed
- Discussion Forums
- » Help with Scripts
-
» Touching block not working







