Welded part won't rotate (TweenService)

I’m working on a door model and I’m new to WeldConstraints. Everything is unanchored (except the hinge) and welded. The door itself opens/closes without any issues, works as expected but I’m also trying to rotate the door handle within the door model when door is opened, to make things look more realistic. But the handle won’t move when it’s welded to the hinge, however it moves when unwelded but falls down.

local TweenService = game:GetService("TweenService")
local primary = script.Parent.Parent.Weld
local opened = script.Parent.Parent.Opened.Value
local clickDetector = script.Parent.ClickDetector
local handle = script.Parent.Parent.Handle

local goal = {
	CFrame = primary.CFrame * CFrame.Angles(0, math.rad(-100),0)
}

local goal2 = {
	CFrame = primary.CFrame * CFrame.Angles(0, 0, 0)
}

local handleGoal = {
	CFrame = handle.CFrame * CFrame.Angles(math.rad(-75),0,0)
}

local info = TweenInfo.new(
	1.5,
	Enum.EasingStyle.Quint,
	Enum.EasingDirection.Out
)

local info2 = TweenInfo.new(
	1.5,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out
)

local handleInfo = TweenInfo.new(
	2,
	Enum.EasingStyle.Quart,
	Enum.EasingDirection.InOut
)

local doorOpen = TweenService:Create(primary,info,goal)

local doorClose = TweenService:Create(primary,info2,goal2)

local handleAnim = TweenService:Create(handle,handleInfo,handleGoal)

script.Parent.ClickDetector.MouseClick:Connect(function()
	clickDetector.MaxActivationDistance = 0
	if not opened then
	doorOpen:Play()
	handleAnim:Play()
	opened = true
	else
	doorClose:Play()
	opened = false
	end
	clickDetector.MaxActivationDistance = 10
end)
1 Like

I’m assuming that you are using a WeldConstraint | Roblox Creator Documentation. One way to do this while maintaining the weld is to use a Weld | Roblox Creator Documentation instead and tween the JointInstance | Roblox Creator Documentation property of the weld.

That’s at least an easy method to do it. Another method that is still possible but not as easy would be to use RunService and calculate the offset every frame while slowly incrementing to your desired and rotation.

2 Likes

Will give it a try, thanks in advance!