Discuss Scratch

THePIZZA123
Scratcher
3 posts

Problem with cloning. Not working after a while.

when green flag clicked
forever
create clone of [ myself]
end
when I start as a clone
wait (0.15) secs
delete this clone



This is the code I used on my platformer. I wanted to make a cool clone effect behind the character like most popular platformers do. I used that script above and it seemed to work fine, but after about 5 min it started to sputter out and the clones just disappeared entirely.
Basic88
Scratcher
1000+ posts

Problem with cloning. Not working after a while.

Change it to:

when I start as a clone
forever
wait (0.15) secs
delete this clone
end

Last edited by Basic88 (May 23, 2020 23:41:02)


I have moved to @BrowserExtension
theanonymousweirdo
Scratcher
500+ posts

Problem with cloning. Not working after a while.

I don't know if this will work, but try putting a wait 0.001secs block in the loop that is making the clones

This is my signature. It appears at the bottom of all of my posts.
My favorite song: You're Not Alone
codentag
Scratcher
100+ posts

Problem with cloning. Not working after a while.

The problem might be because of Scratch's 300 clone limit. If the clones aren't deleting themselves, then once the amount has reached the maximum no more clones will be produced.

Last edited by codentag (May 24, 2020 00:15:08)


“Don't ask about the byte mark.” - Visit my Profile: @codentag

Wintergatan in note blocks


deck26
Scratcher
1000+ posts

Problem with cloning. Not working after a while.

Basic88 wrote:

Change it to:

when I start as a clone
forever
wait (0.15) secs
delete this clone
end
What's the point of that - the clone can only delete itself once.

As already stated this is almost certainly the 300 clone limit. If you're deleting clones of this sprite are you cloning another? The limit is 300 clones in the project, not 300 of each sprite.
THePIZZA123
Scratcher
3 posts

Problem with cloning. Not working after a while.

Thank you everybody I think I was able to solve my problem Message me a link to whatever project you want on my profile and I will advertise it on my new platformer!
THePIZZA123
Scratcher
3 posts

Problem with cloning. Not working after a while.

deck26 wrote:

Basic88 wrote:

Change it to:

when I start as a clone
forever
wait (0.15) secs
delete this clone
end
What's the point of that - the clone can only delete itself once.

As already stated this is almost certainly the 300 clone limit. If you're deleting clones of this sprite are you cloning another? The limit is 300 clones in the project, not 300 of each sprite.
How do I fix that and this is now my new code.
when green flag clicked
set size to (100) %
forever
create clone of [myself v]
end




when I start as a clone
switch costume to [3 v]
repeat (10)
change [ghost v] effect by (10)
change size by (-5)
delete this clone

end

Last edited by THePIZZA123 (May 29, 2020 21:20:40)

shadypineapple
New to Scratch
1 post

Problem with cloning. Not working after a while.

someone please help me fix this ive messed up some how and now it only spawns a few clones ive tryed every thing even creating a block

https://scratch.mit.edu/projects/1017934824/

Last edited by shadypineapple (May 11, 2024 10:27:31)

deck26
Scratcher
1000+ posts

Problem with cloning. Not working after a while.

shadypineapple wrote:

someone please help me fix this ive messed up some how and now it only spawns a few clones ive tryed every thing even creating a block

https://scratch.mit.edu/projects/1017934824/
Please create your own new topic rather than necroposting on someone else's.

Powered by DjangoBB