cache. iscached Synchronous
syn.is_cached
Check whether this exact Instance wrapper is the one stored as canonical in the cache. It is useful after cloneref, which deliberately creates another wrapper for the same engine object.
Luau
cache.iscached(instance: Instance) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
instance | Instance | Instance wrapper to check, rather than merely the underlying engine object. |
Returns
booleantrue when this userdata is the current cached wrapper; false for an uncached clone or an invalidated wrapper.
Usage notes
A cache entry for the engine object does not make every wrapper for that object cached.
Example
Luau
local part = Instance.new("Part")
local other = cloneref(part)
print(compareinstances(part, other)) -- true: same engine object
print(cache.iscached(other)) -- false: separate wrapper
part:Destroy()