Discuss Scratch

Fyx_Fyr
Scratcher
5 posts

Clones not being created

I am making an arena style shooter, and I'm creating clones to be the bullets/projectiles.
The thing is the clones are simply not being created.
Even though I clearly have a “If mouse down then create clone of myself” (and yes it is in forever loop) my clone script isn't working. It isn't glowing when I click and the project is running. And yes, I have pressed the stop button to delete all clones, and I made sure they were not being “hidden”

Here is the project: https://scratch.mit.edu/projects/295351288/
It should be easy for someone who is experienced here to find the problem, as there are only 2 big lines of code which are pretty straight forwards I think.

Is this a bug in scratch, or just a programming error?
Or is my computer just not working.
openPoll
Scratcher
1000+ posts

Clones not being created

Fyx_Fyr wrote:

I am making an arena style shooter, and I'm creating clones to be the bullets/projectiles.
The thing is the clones are simply not being created.
Even though I clearly have a “If mouse down then create clone of myself” (and yes it is in forever loop) my clone script isn't working. It isn't glowing when I click and the project is running. And yes, I have pressed the stop button to delete all clones, and I made sure they were not being “hidden”

Here is the project: https://scratch.mit.edu/projects/295351288/
It should be easy for someone who is experienced here to find the problem, as there are only 2 big lines of code which are pretty straight forwards I think.

Is this a bug in scratch, or just a programming error?
Or is my computer just not working.
I had a look, but I can't tell because I'm on a tablet.
hammer965
Scratcher
100+ posts

Clones not being created

I think that the problem may be that your clone gets created then moves 25 steps 7 times which all happens in microseconds and it is too fast to see anything.

if you slow down the clone movement then it should work. I couldn't see anything else obviously wrong.
PutneyCat
Scratcher
500+ posts

Clones not being created

I think the clones are being created but the “sm” costume is so small that it is invisible. Make it bigger (as a test) and set weapon to 1 or 2, then click the mouse - you'll see the clone.
Joshia_T
Scratcher
500+ posts

Clones not being created

Yes it clearly works, there is something wrong with your sm costume
Fyx_Fyr
Scratcher
5 posts

Clones not being created

Okay I'll try slowing down “sm” and making it bigger
Fyx_Fyr
Scratcher
5 posts

Clones not being created

hammer965 wrote:

I think that the problem may be that your clone gets created then moves 25 steps 7 times which all happens in microseconds and it is too fast to see anything.

if you slow down the clone movement then it should work. I couldn't see anything else obviously wrong.

I found out that if I disconnected the entire clone block, clones would be created (of course without the right costume or movement)

PutneyCat wrote:

I think the clones are being created but the “sm” costume is so small that it is invisible. Make it bigger (as a test) and set weapon to 1 or 2, then click the mouse - you'll see the clone.


I just tried slowing it down to 10 steps and also enlarging the clones by 300% but it is still not working.
The clone blocks aren't even glowing when I press my mouse down.

I did however find out that clones were still being created if I completely disconnected the clone script (of course they weren't the right costume and didn't move).
Does this mean something is wrong with the costume itself?
D-ScratchNinja
Scratcher
1000+ posts

Clones not being created

Maybe you forgot a
show
block?
That's all I have to say.
PutneyCat
Scratcher
500+ posts

Clones not being created

Fyx_Fyr wrote:

Does this mean something is wrong with the costume itself?

Yes, that's what I meant. The costume itself is too small. Draw something big on the costume itself to test.
proeditor2009
Scratcher
100+ posts

Clones not being created

show

need the show block
whenclicked

Need the flag
forevermightneedtheforeverblockto....
pmz23
Scratcher
21 posts

Clones not being created

Your problem is that the bullet clone is going to the player, thus you can not see it, you also need to create a separate sprite for the bullets. Also, I would suggest putting in a wait until not mouse down after the create clone script. How it is right now multiple clones will be created while the mouse is down.
Hope this helps!
pmz23
Fyx_Fyr
Scratcher
5 posts

Clones not being created

PutneyCat wrote:

Fyx_Fyr wrote:

Does this mean something is wrong with the costume itself?

Yes, that's what I meant. The costume itself is too small. Draw something big on the costume itself to test.

No, it is not too small. As I said before I put it's size to 300% of it's original. I drew the sprite again and increased size too and I could see it.

D-ScratchNinja wrote:

Maybe you forgot a
show
block?
That's all I have to say.

If you actually read my first post and actually looked in my project you would know that I did.

pmz23 wrote:

Your problem is that the bullet clone is going to the player, thus you can not see it, you also need to create a separate sprite for the bullets. Also, I would suggest putting in a wait until not mouse down after the create clone script. How it is right now multiple clones will be created while the mouse is down.
Hope this helps!
pmz23

Of course the bullet clone is going to the player (that's literally the point), but it is not showing and or moving at all. And no, you don't need a separate sprite for projectiles emitted, take this as an example: https://scratch.mit.edu/projects/295287235/
Grimlock360
Scratcher
5 posts

Clones not being created

Hmm, I encountered a problem similar to this on scratch 2.0 on my alternate account, also creating clones from mouse clicks.
At that time I assumed I it was just that I had just pushed scratch to it's maximum (the project was extremely large and starting to lag on weaker PCs) and so it wasn't loading certain scripts.
Fyx_Fyr
Scratcher
5 posts

Clones not being created

UPDATE:

It seems to be working properly now.

I backpacked and trashed all the scripts and costumes, then put them back in.
I completely remade the bullet costume and named it something new.

After that, the bullets were shooting out of the player like they were supposed to do.

Still not sure what the cause of it was though…
Yusei-Fudo
Scratcher
1000+ posts

Clones not being created

LexyWexy6659 wrote:

Why are clones not working in my chrome dinosaur game? When the begin variable is equal to one
it will start making clones and i did put a show block but yet no cactuses

If you need help, please make your own topic.
68446
Scratcher
2 posts

Clones not being created

Were the clones set to delete at a certain position? I had the same problem, but then I found out the clones were spawning at the position they were supposed to delete at.
1Goding8
Scratcher
1 post

Clones not being created

That actually works!
sergeantboxers
Scratcher
36 posts

Clones not being created

This post should be closed already. The problem's solved.
27GLEWIS
Scratcher
2 posts

Clones not being created

I figured it out. I know this is really old, but you have to hide the real sprite, and then put a show block in the clone code.

Powered by DjangoBB