Deleting Clones

I’ve been trying a bunch of different methods, but
I really can’t figure out how to delete clones.
I made some type of work around thing, but it wasn’t truly deleting them…

If anyone knows the proper way to delete a clone, please let me know
asap!
This is completely stopping all my progress.

Erm ok. So I believe I MIGHT have discovered what the problem is.
(And if this is really what it is, I’m honestly shocked)
So, for all this time when trying to delete cloned objects, I’ve been doing it like so:
//This while typing in the clips source code…
this.delete();
//This while deleting the clip from an external script…
npc.delete();

//And like this, (more or less) when wanting to delete all the clip’s clones…

for (var i = 0; i < npc.clones.length; i++) {

        if(npc.clones){npc.clones[i].delete();}
        
    }

And for the life of me, I couldn’t figure out what was wrong.
The clip would never “actually” delete…

Then, after testing various things, I tried the above method, but this time on
a clip located within the ‘main’ frame on my timeline,
(For context, I’m making a game, and the game is located within the first timeline frame,
what I was attempting to do was to clone a clip from a separate frame.)
and it worked!
The clip actually deleted!

So, does that mean this whole time, the script itself was correct, but for some reason
you aren’t able to clone a clip from a different timeline frame and delete it?
If that’s the case, why? A bug or something? Idk, but I hope if anyone reads through
this whole thing, and was having the same problem as me, this can eliminate some confusion.

I can go more in-depth and explain this more clearly if
anyone is interested.

Also, I’m using the Live editor!

Hey @colorsCrimsonTears,

Unfortunately the live editor has ALOT of issues with scope when it comes to the code editor, which I believe is what’s happening here. Many of these problems have been addressed in the Alpha editor.

For instance, in the alpha, calling

clip.remove()

should work in all cases for this!

We unfortunately cannot fix this problem in the live editor.

1 Like

Oh, ok! Thanks for letting me know!
I kept thinking I was doing something wrong for a while and it was driving me batty! :joy: