Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using Instance.Parent as table keys doesnt work #242

Open
FlowGnarly opened this issue Aug 21, 2024 · 1 comment
Open

using Instance.Parent as table keys doesnt work #242

FlowGnarly opened this issue Aug 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@FlowGnarly
Copy link

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.

@filiptibell filiptibell added the bug Something isn't working label Aug 21, 2024
@eAi
Copy link

eAi commented Sep 1, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants