Skip to content

compareinstances

compareinstances checks if two Instances are equal.

This is primarily used for instances which have been cloneref'd, where the normal equality check with == fails.

function compareinstances(object1: Instance, object2: Instance): boolean

Parameters

Parameter Description
object1 This first Instance to compare.
object2 The second Instance to compare against.

Example

Comparing instances
1
2
3
4
print(compareinstances(game, game))              -- true
print(compareinstances(game, workspace))         -- false
print(compareinstances(game, cloneref(game)))    -- true
print(game == cloneref(game))                    -- false