-
I want a door that can stay open for like 5min+ and only will close if I click the other button.
-
The issue is that the door is opened and it just closes very fast, it should stay open but it closes.
-
Looking on similar topics but can’t really find the same issue.
https://gyazo.com/617585680a5c14ff64df22f8d5d1a198
local door = game.Workspace:WaitForChild("Animated Door") --Locate the door in workspace
local debounce = false
local door1 = false
local animation = Instance.new("Animation") --Create the animation
animation.AnimationId="http://www.roblox.com/asset/?id=6115495997" --Get the animation from Roblox
local loadedAnimation = door.AnimationController:LoadAnimation(animation) --Load the animation to the controller
game.Workspace.Button.ClickDetector.MouseClick:Connect(function() --Connect a function when the ClickDetector is pressed
if not debounce then
debounce = true
print("clicked")
loadedAnimation:Play() --Play the animation
wait(loadedAnimation.Length) --Wait till the animation is at the very end
loadedAnimation:AdjustSpeed(0) --Pause the animation at the end
debounce = false
end
end)
game.Workspace.Button1.ClickDetector.MouseClick:Connect(function() --Connect a function when the ClickDetector is pressed
if not debounce then
debounce = true
print("clicked")
--Play the animation
wait(loadedAnimation.Length) --Wait till the animation is at the very end
loadedAnimation:AdjustSpeed(-1) --Pause the animation at the end
wait(loadedAnimation.length)
loadedAnimation:AdjustSpeed(0)
debounce = false
end
end)
DoorAnimationTest (2).rbxl (21.1 KB)