I’ve recently run into an issue when creating an animated door. Basically, it isn’t fully animated. There are no errors or any other kind of messages in the output, and the only thing that has a functional animation is a door’s hinge - It rotates when the proximity prompt is triggered. I tried looking for help on DevForum, but I didn’t find anything.
Here’s how the door looks in the explorer:
All of the parts are anchored. WeldConstraint is connected ‘Part0 - Hinge’ and ‘Part1 - Door’ - I already tried replacing Part0 with Part1, which didn’t work.
And here’s the code:
local TweenService = game:GetService("TweenService")
local Hinge = script.Parent
local Goal = {
CFrame = Hinge.CFrame * CFrame.Angles(0,math.rad(90),0)
}
local Goal2 = {
CFrame = Hinge.CFrame * CFrame.Angles(0,0,0)
}
local tweenInfo = TweenInfo.new(1)
local doorOpen = TweenService:Create(Hinge, tweenInfo, Goal)
local doorClose = TweenService:Create(Hinge, tweenInfo, Goal2)
local isOpen = false
script.Parent.Parent.Door.ProximityPrompt.Triggered:Connect(function()
if isOpen == false then
doorOpen:Play()
isOpen = true
else
doorClose:Play()
isOpen = false
end
end)
I can’t find a way to make it work, so I hope you can find the issue. I’m really sorry if the problem is extremely simple to resolve, and I was just too dumb to find it.
Unfortunately, this doesn’t seem to work. Even after unanchoring every part, except for the hinge, and then triggering the ProximityPrompt - the door doesn’t move (But the hinge does as it previously would). The door just… well, falls when I walk into it.
As I already noted in my post - I tried it, and it unfortunately didn’t work. I’ve just opened up the studio to make sure. The hinge rotates those 90 degrees as it should. The door on the other hand doesn’t.
That sounds very much like the fault is in welding. Every part in the door should be unanchored and individually welded to the anchored hinge or some “middle-man” part (also unanchored), which is then welded to the hinge. I’ve managed to solve it successfully this way.
Hey! Sorry for responding so late, but guess whose idea managed to work - I put a weld in a door, connected it to the hinge, unanchored the door, and now it works! Thank you!