Problem with Tween Door

I’m trying to make a door which moves with a hinge with a tween. The hinge moves perfectly but the door wouldn’t move with the hinge.
This is the model in Explorer:
image
This is the model in Studio:
image
The red part is the Hinge and the white part is the door.

Whenever I click the door the Hinge rotates but the door doesn’t move with it.
image

I have tried using constraints but it still wouldn’t budge.
This is the script I use:

local tweenservice = game:GetService("TweenService")
local part = script.Parent
local tweeninfo = TweenInfo.new(0.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out, 0)
local newor = part.Orientation + Vector3.new(0,90,0)
local tween = tweenservice:Create(part,tweeninfo, {Orientation = newor})
local click = part.Parent.Main.ClickDetector

click.MouseClick:Connect(function()
	tween:Play()
end)

Any help is appreciated!

2 Likes

unanchor the door part if it is anchored

1 Like

The door is not anchored but the hinge is.

1 Like

changing it to a normal weld worked with me you’ll have to do some tweaking to get it to stay in the right position though


image

1 Like

Tried using it but still wouldn’t work. I dont want the door to just rotate 90 degrees, I want the hinge to move 90 degrees and the door to move with the hinge.

hello! that is what we are doing?
if the door is welded to the hinge then the door will rotate with the hinge

Yes, but I want the door to move into a different position, not just change horizontally. I tried adding a hinge between the door and the hinge. It works, but it teleports when the tween is done, not while the tween is playing.

Nevermind I just removed the hinge and rewrote the script and fixed it.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.