Hi everyone!
As I am right now finishing up my building system, I’ve come across this very infuriating issue where CollectionService
can’t find the tag that I just added…?
The reason why I’m doing this is because I want to check if the prop the player just placed is within the boundries of their “node” (a.k.a their little plot)
Here’s the function that checks it:
local function checkIfInsideNode(node, object)
local min = node.Position - (0.5 * node.Size)
local max = node.Position + (0.5 * node.Size)
local region = Region3.new(min, max)
local parts = workspace:FindPartsInRegion3(region, node, 100)
for _,v in pairs(parts) do
if tagService:HasTag(object, "Object") then
tagService:RemoveTag(object, "Object")
print('yes')
return true
end
end
print('no')
return false
end
And here’s the part where I add the tag
local clone = item:Clone()
clone.Parent = node
clone:SetPrimaryPartCFrame(pos)
tagService:AddTag(clone, "Object")
I am still very confused as to why this happens.
Help is appreciated!