Trouble with Clones


#1

So basically, I’m trying to create lightning with clones of circles, which fades and then appears elsewhere on the screen. It’ s supposed to get thinner as it gets lower down, but for some reason nothing happens. Why doesn’t it work? Here’s a link:


@CodeHelp


#2

Hi @Legendary_myth

I saw there were some replies on the General Discussion Topic, but couldn’t tell if you got the help you needed because there was too much other chatter. I’m at work now but will check in later to see if you still need help. Hopefully others can help between now and then :grinning:


#3

Thanks. I’ve already implied the other ones into my code and they don’t work.


#4

Sadly I can’t check code since I don’t have Hopscotch anymore, but a common mistake is not setting all clones to do the same thing (if desired)


#5

Try setting the size to the y position divided by some number!


#6

Depends what you mean by “nothing”. The lightning works but the clouds just take a really long time to load the way you have it.

Fyi, the little number in the image is the total objects at the time I took the screenshot. I just added this, just for troubleshooting, to the text object:

You’re not setting the size of clones


Here’s a couple other comments

  • You should never code a project to continuously make clones. You’ll eventually hit the 4096 object limit and the project will quit working. But long before that the lag will increase and the performance will grind to a halt

  • The lightning doesn’t start until there are 601 clones already created. That’s a lot of clones (which affects performance) just for clouds. Perhaps consider drawing the clouds instead? I’d draw a thick black line for the part that’s all black & draw random circles just along the bottom edge. If you have to have objects, I’d put a big rectangle for the all black part and still only put circles along the bottom edge

  • Regardless of whether you use objects or trails for the clouds, I’d recommend you use different objects for the clouds and lightning, as the setup will be faster and it’ll be less complicated


#7

Here you did some stuff wrong so I edited it and got this


#8

Thanks for the help.