Hello, I just created a sliding door.
I'm having one issue which is the sliding door keeps sliding more if you keep hitting the zone, which then means it doesn't slide back into position properly.
Code is shown below:
script.Parent.Zone.Touched:Connect(function()
if not debounce then
debounce = true
for i,v in pairs(door1:GetChildren()) do
tweenServ:Create(door1[v.Name],tweenInfo,{CFrame = CFrame.new(door1[v.Name].Position - Vector3.new(3.6,0,0))}):Play()
end
wait(2)
for i,v in pairs(door1:GetChildren()) do
tweenServ:Create(door1[v.Name],tweenInfo,{CFrame = CFrame.new(door1[v.Name].Position + Vector3.new(3.6,0,0))}):Play()
end
debounce = false
end
end)
Any suggestions would be appreciated.

6 comments
What is the scope of debounce?
what's a scope? Sorry, extreme beginner here
Did you set your debounce to false before the .Touched event?
yes, it is set to false before
is all you parts/Models Spelled right?
all spelt right, no errors and door works fine apart from the fact it just keeps sliding if I go in and out the zone repeatedly