Is there a method to check if two models/objects are the same?

for example i want to clone this and store it in a folder


image

cloning it twice will clone the same objects twice, i’d like it to not download the same thing more than once
would i have to check if some properties are the same and assume its the same object?
or is there another option to do this

3 Likes

I didn’t quite catch the issue. I assume that you want to change the parent of the model right? If so then set the Parent property to the folder you wanted to go.

3 Likes

prob no but you can just rename them to a speaical name so you can check wether it got cloned or nah on the map if you meant by this

4 Likes

ill try this thanks
srggggrggg

2 Likes

I assume you could make use of an ifelse statement, checking whether an object in the folder or service you’re using, already has that name or not.

1 Like

streamings enabled so objects unload themself on client and stuff gets renamed to its original name when reloaded

im thinking of comparing properties like position, anchored, name, colour and check for matches
is this an ok solution or is there a better method for this?

1 Like

Sorry, I still don’t quite get your original concern. Can you rephrase it?

2 Likes

sorry
im trying to cache an area to a folder while the game has streaming enabled; parts of the map will be unloaded so itll save while the player moves around the map
i dont want it to save the same thing more than once so im trying to find out how i can check if two models/objects are the same

1 Like

Why do you need to save something that will return to how it was naturally? The whole idea of streaming is to load and unload instances for performance boosts; trying to keep the downloaded instances defeats its purpose. Besides, when an instance is streamed out, it is deleted, so it’s not like you’re creating clones on the client

1 Like

I wonder if something like this would cut down the number of parts you had to check …

----- models
local model1 = workspace:WaitForChild("Model1")
local model2 = workspace:WaitForChild("Model2")

local size1 = model1:GetExtentsSize()
local size2 = model2:GetExtentsSize()

if size1 == size2 then
	print("Same size")
end

----- parts
local part1 = workspace:WaitForChild("Part1")
local part2 = workspace:WaitForChild("Part2")

local size1 = part1.Size
local size2 = part2.Size

if size1 == size2 then
	print("Same size")
end
1 Like