Hey, I’ve been working on a door that opens, this video will show how.
As you can see, at the end I can’t go through the door even though the door has moved. Any solutions? (Yes I have tried to go in it different ways, so its not the size thats the problem)
My code is:
local D = script.Parent.Detector
local DE = false
local T = game:GetService(“TweenService”)
script.Parent.PrimaryPart.Touched:Connect(function(h)
if DE == false then
if h.Parent:FindFirstChildWhichIsA(“Humanoid”) and h.Parent ~= workspace.SCPS then
if h.Parent:FindFirstChild(“ClassDCard”) then
D.BrickColor = BrickColor.Green()
D.Material = Enum.Material.Neon
D.beep:Play()
DE = true
for _,v in ipairs(script.Parent.Parent:GetChildren()) do
print(“aA”)
if v:IsA(“BasePart”) then
v.CanCollide = false
local E = T:Create(v, TweenInfo.new(1), {Position = v.Position + Vector3.new(-4)})
E:Play()
end
end
wait(2)
for _,v in ipairs(script.Parent.Parent:GetChildren()) do
print("aA")
if v:IsA("BasePart") then
v.CanCollide = false
local E = T:Create(v, TweenInfo.new(1), {Position = v.Position + Vector3.new(4)})
E:Play()
end
end
D.BrickColor = BrickColor.Gray()
D.Material = Enum.Material.SmoothPlastic
wait(1.5)
DE = false
elseif h.Parent:FindFirstChild("CanUnlockNothingCard") then
D.BrickColor = BrickColor.Red()
D.Material = Enum.Material.Neon
D["Error Beep"]:Play()
DE = true
wait(2)
D.BrickColor = BrickColor.Gray()
D.Material = Enum.Material.SmoothPlastic
DE = false
end
end
end
end)
as you see, I have tried turning cancollide to false.