Hullo again, Defold Community~
So, this time around, I’m trying to look for an instance’s full URL through a collision script (because I can’t think of any other way to find something’s URL when there’s going to be so many of them).
I tried to use a variable to store the URL of the instance (which makes it hashed, but I think that’s fine?):
if message.other_group == hash("interactable") then
if message.own_group == hash("center") then
if message.enter then
curinteract = message.other_id
else
curinteract = nil
end
end
end
Then I write code in order to give it an interacting message:
if curinteract then
if button1 then
msg.post(area..curinteract, "interact")
interacted = true
elseif interacted and not button1 then
msg.post(area..curinteract, "interact_end")
interacted = false
end
end
I think the problem has something to do with not being able to find the collection that the instance is in(because the character which is in one collection is collection-factoried
into existence in an area where the interactable NPC is also collection-factoried
into existence), but I don’t know how to do that. Can someone help me with that?
Any help would be appreciated~~