lune
lune copied to clipboard
using Instance.Parent as table keys doesnt work
Minimal repro
local roblox = require("@lune/roblox")
local obj = roblox.Instance.new("DataModel")
local child = roblox.Instance.new("ObjectValue")
child.Parent = obj
local t = {
[obj] = 100,
}
print(t[obj]) -- 100 ✅
print(t[child.Parent]) -- nil ❌
I could just use GetFullName() instead of the instance itself, so this isnt really an issue for me, but I thought I'd make an issue for it anyway.
I've seen a similar issue and spent most of an evening tracking it down. Basically there seems to be situations where there are two Instance objects that reference the same underlying object in the model or place file. They are considered == to each other but rawequals returns false. I was tearing my hair out over it! It'd be really good if there was only ever one Lua object for any one object in the model/place hierarchy.