Does Instance.fromExisting clone properties that reference objects?

I don’t really have access to Roblox Studio right now, so yeah I was wondering if Instance.fromExisting copies properties like Part0 or Part1 for example

Does it keep the same references? Does it set them to nil? IDK

Pls help :pray:

Thanks

What are those tags bro

2 Likes

yes, of course. fromExisting return equal object
image

local weld = Instance.new("WeldConstraint") do
	for iteration = 1,2 do
		local part = Instance.new("Part")
		part.Parent = workspace
		part.Name = `Part{iteration}`
	end
	
	weld.Parent = workspace
	weld.Part0 = workspace.Part1
	weld.Part1 = workspace.Part2
	
	local newWeld = Instance.fromExisting(weld)
	print(newWeld.Part0) -- Part1
end

So it just has the same references as the original object?

1 Like

yep

Спойлер

Этот текст будет скрыт

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.