Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Should Game.Debris be used or :Destroy() ?

Asked by 5 years ago

So, I want to make a part disappear or be eliminated from the game world. Which do I use, destroy or adding to game.debris? Please respond.

0
Debris was used in the old days. I'd use Destroy User#19524 175 — 5y

1 answer

Log in to vote
2
Answered by
chomboghai 2044 Moderation Voter Community Moderator
5 years ago

The Debris service is usually used when you want an instance to be removed from the game after a set period of time. This is usually in cases like shooting a projectile or when you have any instance that has a specific lifetime.

If your part does not have a set lifetime, and instead you would like for the part to be removed upon a certain event triggering, or anything otherwise then feel free to use :Destroy().

Also note that Debris does not error if the object is already destroyed when it tries to remove the object, however :Destroy() does.

Hope this helps! :)

0
You sniped me, I'm 50 seconds to late, I'll remove my answer as yours is better. jaschutte 324 — 5y
Ad

Answer this question