Door hinge not working

So basically I want my door to rotate smoothly… I am very new so please be patient with me as I might not get what you are talking about. I want the door to open smoothly using a hinge part with CFrame (I named it Center) It opens when you walk into the hitbox (the hitbox works its just the door doesn’t)

The door doesn’t work with the hinge for some odd reason. I have the Center part (hinge) set to the Model as the primaryPart. I also have the center part with a WeldConstraint. Part0 is set to the Door and part1 is set to the center part. The center part is also anchored but the Door is not. I am not really sure what the problem is…

I have looked at some other people who had this problem but I couldn’t really find anything that could help me.

I am not asking for anyone to write me a whole other script, I need to know what I could possibly change in my script that could make the door move.

Here is a picture of my script.

1 Like

did you play the tween? and this should me smooth aslong as you do the correct way of tweening objects

im not an expert of tweenservice and i have not used it before, i only use tweenposition

yea I played the tween, I did :Play() on the end. Not sure if that is the correct way doe

Are you able to send the code in text form since we cannot see it fully?

yea here you go, I am not certain of how to make it look like actual code lol

local tween = game:GetService (“TweenService”)

local center = script.Parent.Center
local door = “Closed”

local CF = (“CFrameValue”)
CF.Value = center.CFrame
CF.Changed:Connect (function()
center.CFrame = CF.Value

local debounce = false
if hit.Parent:WaitForChild(“Humanoid”) then
if debounce == true then return end
debounce = true
if door == “closed” then
tween:Create(CF,, Enum.EasingStyle.Back, Enum.EasingDirection.In,0,false,0), {Value = center.CFrame * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))}):play()
door = “open”
tween:Create(CF,, Enum.EasingStyle.Back, Enum.EasingDirection.In,0,false,0), {Value = center.CFrame * CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0))}):play()
door = “closed”
debounce = false

I’m not sure if it matters, but try capitalize the P in play since I never see it as a lowercase.

that didn’t do anything sadly.

You are setting door to “Closed” instead of “closed”

1 Like

Do Parts welded to tweened CFramed anchored Parts still move with the CFramed Part?
I’ve used HingeConstraints for doors since they came out. Fairly simple system really.

Oh… I’ll try that tmr since it’s late for me

ok it worked but the door is not moving with it. The Door is not anchored, the center part is. I also weld both of them together.

nvm I got it working thank you