this.destroy() unexpected behavior?

It says "Destroys this component instance." but after calling it I don't see that it was destroyed.
open() {
this.minInteractions = 0;

const egg = this.instance;
const top = egg.Top;
const bottom = egg.Bottom;

top.Base.WeldConstraint.Destroy();
top.Parent = game.Workspace;
bottom.Base.WeldConstraint.Destroy();
bottom.Parent = game.Workspace;

this.destroy();
}
open() {
this.minInteractions = 0;

const egg = this.instance;
const top = egg.Top;
const bottom = egg.Bottom;

top.Base.WeldConstraint.Destroy();
top.Parent = game.Workspace;
bottom.Base.WeldConstraint.Destroy();
bottom.Parent = game.Workspace;

this.destroy();
}
4 Replies
PoppingPopper
PoppingPopperOP3y ago
Before and after pics from explorer after running open
No description
PoppingPopper
PoppingPopperOP3y ago
No description
PoppingPopper
PoppingPopperOP3y ago
Hmm turns out I have to use this.instance.Destroy()
Osyris
Osyris3y ago
I believe this destroys the component class instance, not the Roblox Instance. Different use cases

Did you find this page helpful?