Working Door Handle

I recently made a door that can be opened with a click. It works amazingly, and it looks good, but I have one slight issue. I tried to make a tween where the door handle would move when clicking but the door handle can’t be tweened if it’s welded to something.

Issue:

  • My door handle can’t move because it is welded to the door which is welded to a hinge part. If the door handle were to move it would move the whole door with it.

Workspace:

With being welded:

robloxapp-20230412-2316009.wmv (130.4 KB)

Without being welded:

robloxapp-20230412-2315032.wmv (231.9 KB)

My Code:

local TweenService = game:GetService("TweenService")

local hinge = script.Parent.DoorHinge
local ClickDetect = script.Parent.Door.ClickDetector
local HandleHinge = script.Parent.HandleHinge


--Door Hinge
local goalOpen = {}
goalOpen.CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(90), 0)

local goalClose = {}
goalClose.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0)

local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen)
local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose)




--Handle Hinge
local goalOpen2 = {}
goalOpen2.CFrame = HandleHinge.CFrame * CFrame.Angles(math.rad(-30), 0, 0)

local goalClose2 = {}
goalClose2.CFrame = HandleHinge.CFrame * CFrame.Angles(0, 0, 0)

local tweenInfo2 = TweenInfo.new(.5, Enum.EasingStyle.Back, Enum.EasingDirection.In)
local tweenOpen2 = TweenService:Create(HandleHinge, tweenInfo2, goalOpen2)
local tweenClose2 = TweenService:Create(HandleHinge, tweenInfo2, goalClose2)






Open = false

ClickDetect.MouseClick:Connect(function()
	if Open == true then
		tweenClose2:Play()
		wait(.5)
		tweenClose:Play()
		wait(1)
		Open = false
	else
		tweenOpen2:Play()
		wait(.5)
		tweenOpen:Play()
		wait(1)
		Open = true
	end
end)

What is an alternate option I can do to make the door handle animated but also make it move with the door?

One option you can consider is creating a separate part for the door handle that is not welded to the door or hinge, but is instead connected to the door through a Script or a BodyPosition constraint. This will allow you to animate the door handle independently while still keeping it attached to the door.

Use a HIngeConstraint between the handle and door and set it to Servo so you can script the angle for it to rotate between the open and closed positions.
HingeConstraints will move with the Unanchored Door part if it is welded to your anchored Tweened door hinge.

a good way to do this is manipulate the C1 or C0 of the weld that connects the handle to the rest of the door.