-
What do I want to achieve? I want to detect when something anchored is touching a part
-
What is the issue? For some reasons, the touched doesn´t work, only when isn´t anchored.
-
What solutions have I tried so far? I tried using region3 but it doesn´t work too.
local part = script.Parent
local region = Region3.new(part.Position - part.Size/2, part.Position + part.Size/2)
while wait(1) do
print("BUCLE")
local parts = workspace:FindPartsInRegion3(region)
for i, part in pairs(parts) do
local grab = part.Parent.Parent
local bonesdamage = part:FindFirstChild("Bones")
if grab.Name == "BlockToDetect" and bonesdamage then
print("Detectected")
local bDamage = bonesdamage.Value
local health = script.Parent.Health--In this part the script quit life from a block when it detect the block touch it
health.Value = health.Value - bDamage
print(health.Value)
end
end
end