How would I move only one part in a weld?

Trying to make a doorknob that goes down and up (with a tween) when the door is opened while following the door.

I’ve been trying for days now and just can’t seem to make it so as the last resort I’ve come to the DevForum.

Tried runservice (to constantly have it in a certain place), lerping (with an in pairs loop) practically everything, but one thing that I’m really curious about is if I can move only one part in a weld (not a weldconstraint) also maybe if it’s possible how can I make it so that the part0 doesn’t change cframe (position/rotation) after welding. I have also tried the Weld.C0 property of the weld like this:

Weld.C0 = downKnob.CFrame -- a cframe of the knob tilted down so it tweens down

or

Weld.C0 = knob.CFrame -- or CFrame.new() with the cframe of where i want the knob to be

but it seems to mess it up even more.

In short if anyone has a clue or two about how can I move only one part in a weld (not a weld constraint) it’d be very nice. Also here’s my door code that open and closes the door for no reason:

local ts = game:GetService('TweenService')

local door = workspace.door.doorMain
local hinge = door.Parent.Hinge
local prompt = door.Parent.knob.ProximityPrompt
local knob = door.Parent.knob

local c = 0

local goalFront = {
	CFrame = hinge.CFrame * CFrame.Angles(math.rad(90), 0, 0)
}

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

local ti = TweenInfo.new(
	2,
	Enum.EasingStyle.Cubic,
	Enum.EasingDirection.Out
)


local front = ts:Create(hinge, ti, goalFront)
local back = ts:Create(hinge, ti, goalBack)

prompt.Triggered:Connect(function()
	c = c + 1
	front:Play()
	if c == 2 then
		c = 0
		back:Play()
	end
end)

Do you have an place file you can send me?
Maybe I can get it working, as I have been working on doors and tweening lately.

I’m not certain if this would fix the issue, but you could add an invisible part where the door handle is. Weld the parts of the door handle to this invisible part, and then weld the invisible part to the door itself (or, the part of the door that rotates). Then, just rotate the invisible part however you’d like

doorweld

If you’ve been working with doors lately why won’t you try explaining how you work around my problem?

Also, I think you could have a .Changed event on the door’s position, so that you can use a calculation to move the handle based on the door’s position

But actually you should be able to tween the handle and tween the door.

Not sure really what problem you are having.

I just noticed you are trying to get rotation while tweening the handles cframe, I would put a HingeConstraint, and tween that to get the handle to turn

The way tweening works is that it goes from a to b in a straight line and thats not how the door moves.
So tweening just tweening the handle

Like I said, use a hinge constraint, to get the rotation for the hinge, don’t cframe it

Also, when I said send me a place file, I am not trying to get your project, I thought you might have some little test place with only the door, just to test the mechanics, sort of like I posted on this …

The hinge in the script is the object that moves the whole door not the knob. I think you got it wrong.

I think you can just change Weld.C1 to change the offset
that way you won’t have to worry about following the door around or tracking start/end positions

I realize that, but arent you also wanting the knob to rotate?
You could have a hinge on both.

This is likely the method I would use, avoiding welds alltogether with CFrameValues and Model:SetPrimaryPartCFrame(CFrameValue.Value) + tweens

(This is assuming they are anchored)

Alright
door.rbxl (99.5 KB)

Is this sort of what you are wanting?
door.rbxl (106.4 KB)

Yeah that was what I wanted (modified the script to my likings) and thanks a lot. I really didn’t I could’ve used a hinge like that especially didn’t know the property HingeConstraint.TargetAngle.

No problem, and good luck with your project.