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

Should I clone a part instance to create a new ore or should I create a new ore each time I need to?

Asked by 5 years ago

I have a bunch of droppers that I need to loop through and have them drop ores. I was thinking: is it more efficient to :Clone() an already created part like this:

local oreToClone = Instance.new("Part")
local ore = oreToClone:Clone()

or should I just create a new instance per ore like so:

local ore = Instance.new("Part")

I hope you can help. Thanks!

0
If you want to start from scratch I'd create a new instance User#19524 175 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

If the part you want to create or clone every time the dropper activates has alot of changed variables such as brickcolor, size and name then i suggest using Clone to limit the amount of lines because using Instance.new("Part") creates a new part with default parameters (2x4x1 dimensions) except if you use more code lines to change the parameters:

local part = Instance.new("Part")
part.size = Vector3.new(1, 1, 1)
part.brickcolor = brickcolor.new("Bright red")

But its really up to you.

0
lel very simple question. (also you can later change material position etc.) Fragmentation123 226 — 5y
0
sometimes simple questions require complicated answers 20002000sa 83 — 5y
Ad

Answer this question