Help with TweenService + Anchoring

Hi there!

I’m trying to make a door with a rotating handle using TweenService. My problem is that the hinge for the handle has to be anchored to turn, however to move with the door the hinge for the handle has to be welded to the door or the doorhinge.

My question is: is there any way to make this work? Can I somehow make the handle turn while attached to the door so it turns with the door?
Here’s the code I have so far (with all the code to make sounds + the door play cut out as those work perfectly)

local TweenService = game:GetService("TweenService")

local prompt = script.Parent.Door.ProximityPrompt
local handlehinge = script.Parent.HandleHinge

local goalOpenHandle = {}
goalOpenHandle.CFrame = handlehinge.CFrame * CFrame.Angles (0, 0, math.rad(-45))
local goalCloseHandle = {}
goalCloseHandle.CFrame = handlehinge.CFrame * CFrame.Angles (0, 0, 0)

local tweenInfoHandle = TweenInfo.new(0.25)
local tweenOpenHandle = TweenService:Create(handlehinge, tweenInfoHandle, goalOpenHandle)
local tweenCloseHandle = TweenService:Create(handlehinge, tweenInfoHandle, goalCloseHandle)

prompt.Triggered:Connect(function()
	if prompt.ActionText == "Close" then
		wait (1)
		tweenOpenHandle:Play()
		wait (0.25)
		tweenCloseHandle:Play()
	else
		tweenOpenHandle:Play()
		wait (0.25)
		tweenCloseHandle:Play()
	end
end)

Also, here’s the exploded weld setup for the door in case I need to edit any welds to make this work
hhhh

I’m confused. goalOpenHandle.CFrame = handlehinge.CFrame * CFrame.Angles (0, 0, math.rad(-45)), isn’t goalOpenHandle a variable you made, and are you trying to set the CFrame of a variable. Please correct me if I’m wrong.

I’m not a scripter, I got this script from a YouTube video and I don’t fully understand how it works, but I’ll give it a go:

I define the variable of goalOpenHandle and goalCloseHandle, then give a CFrame value to them. I then create tweenInfoHandle as a variable and make this a new tween. I then define 2 new variables, tweenOpenHandle and tweenCloseHandle, make them tweens and link them with handlehinge, tweenOpenHandle and the respective goal (OpenHandle or CloseHandle). This then enables me to play each tween at the time I wish

Once more, I am not a scripter and I’d recommend watching the YouTube video to understand this script (link: E to Open Door | Proximity Prompt | Roblox Scripting Tutorial - YouTube)

Make it “turn” relative to a designated part, multiply the cframe for each loop.

I found a tutorial that would help with what you are looking for!