[SOLVED] How to keep clones after pausing

I know how to keep normal objects after pausing, but not clones…

Clones don’t persist between sessions so
Long story short: no

I think that there is actually a way to do this.

All clones created are added to an array of clips in the frame. Then when the project resets, that array is set to how it was before the project was paused. You can, while the project is playing, add clones directly to the array that the project resets to so that the clones stay in the project after resetting.

This code will add a clone to that array:

this.parentFrame._cachedSerializeData.children.push(this.uuid);

Make sure to run the code only once and when you have the object in the frame that you want it.

IMPORTANT:
The clones will STILL be defined as CLONES of the original clip…
So make sure you disable the code that adds them to the frame’s cachedSerializeData for the children array to avoid lag. I do this by checking whether or not the array has the clones’ uuid code before adding them to it.

if(!this.parentFrame._cachedSerializeData.children.includes(this.uuid)){
this.parentFrame._cachedSerializeData.children.push(this.uuid);
}

Side note: When you pause the project, the clones will still be there, but the first time you run the project the code inside of these new clones will not be run. After you pause the project, this issue is somehow fixed however, and everything should work fine afterwards.

Here’s a test project:
Immortal Clones.wick (2.2 KB)

I haven’t done enough testing with this, so far that file is all I have.
It should help show how the code works.

1 Like

Thx for helping
I made this with it: 6-2-2022_20-04-11.wick (10.9 KB)

1 Like