I have a problem with my project

Fill this out this info to make it easier for the community to help you! If you don’t fill out this information, your post may be deleted or removed.

What Wick Editor Version are you using?
1.19.3

Describe the Problem
So i had this idea for a game…
You played as a tiny stump and you had to collect pellets coming towords you.
My idea for the pellets was to have all the pellets in a clip and tween the clip towords the player.
That didn’t work…
All the pellets would dissapear when i touched 1 of them.

What have you tried so far?
I have tried going into the clip and making each pellet a clip.
Then putting the code in each single one but when i try to play i just get an error on the first line of code
Do you have a Wick Editor File that we can see? Optional*
Heres the file:https://drive.google.com/file/d/1NixCDebiey51J32G9Hhj0Yj7QsafJWzx/view?usp=sharing

It would be best to use clones.

when you use clones, you can use each individual pellet to check if it is touching the stump. if it is, remove it. otherwise, move the pellet. when the pellet goes off-screen (check its y-coordinate), remove the clone and, if applicable, make the player lose.

you need to be careful that each clone doesn’t make a clone of itself though. for example, when you have 1 pellets, it makes 1 clone and you have 2. but when you have 2 pellets, you don’t want each of the 2 pellets to make a clone, since now you will have 4. and then 8, then 16, and so on. to solve this, you can use an external script (not the pellet’s script) and create the clone there.

if you don’t know how to make/use/delete clones, you can ask that too and we’ll help you out.

1 Like

Hello.
Thanks for the reply.
Yes i would like to know how to make/use/delete clones.

Making Clones

You can either make a clone with cloneName = clipToClone.clone(); or clipToClone.clone();.

Using Clones

With the first method, you can change things about it like cloneName.myVar = myValue;

It is usually useful to use the clip.isClone() condition, which, as the name suggests, returns whether clip is a clone. For example, when I talked about this…

… you can write some code to prevent this. Instead of this, which creates the problem I talked about…

// UDPATE SCRIPT
this.clone()

… you can do this.

// UPDATE SCRIPT

// the exclamation mark means "not", so if
// this is not a clone (if this is the
// original clip), make a clone
if(!this.isClone()) {
    this.clone()
}

This is the main use for clip.isClone(), although there are more ways to use them.

Removing/Deleting Clones

When you want to delete a clone, use clip.remove(), where clip is the clip to remove. You can always use this.remove() to remove the clip running that line.

Conclusion

If you need more help, search around on the forum, and I’m sure you will find some help, examples of clones, and things like that.

It should be clip.isClone, instead of clip.isClone()

1 Like