I believe now the problem is the axis at which it’s rotating.
script.Parent.Parent.Parent.Parent:SetPrimaryPartCFrame(script.Parent.Parent.Parent.Parent:GetPrimaryPartCFrame() * CFrame.Angles(0, math.rad(45), 0))
try this line ^
I believe now the problem is the axis at which it’s rotating.
script.Parent.Parent.Parent.Parent:SetPrimaryPartCFrame(script.Parent.Parent.Parent.Parent:GetPrimaryPartCFrame() * CFrame.Angles(0, math.rad(45), 0))
try this line ^
I already have it in my code. Still this mess.
Try to change math.rad(45)
to a different axis.
Can you send me the line of the code that is rotating the door?
script.Parent.Parent.Parent.Parent:SetPrimaryPartCFrame(script.Parent.Parent.Parent.Parent:GetPrimaryPartCFrame() * CFrame.Angles(0, math.rad(90), 0))
This is might be because CFrame.Angles need’s a radian value for it’s parameters.
Also SetPrimaryPartCFrame and GetPrimaryPartCFrame might be deprecated soon.
And in CFrame.Angles(-47.5, 3.975, 128.25)
your trying to move the door, not rotate it again.
local Button = script.Parent
local ClickDetector = Button.ClickDetector
local TextLabel = script.Parent.Parent.Parent.Screen.CodeScreen.SurfaceGui.TextLabel
ClickDetector.MouseClick:Connect(function()
if TextLabel.Text == "696969" then
TextLabel.Text = "Access Granted! Opening Door..."
wait(2.9)
script.Parent.Parent.Parent.Parent:PivotTo(CFrame.new(-47.5, 3.975, 128.25) * CFrame.Angles(0, 0, math.pi / 4))
end
end)
Less mess than before:
Maybe change the rotation on the y axis instead.
script.Parent.Parent.Parent.Parent:PivotTo(CFrame.new(-47.5, 3.975, 128.25) * CFrame.Angles(0, math.pi / 4, 0))
Why not try CFrame.Angles(0, math.rad(60), 0)
or CFrame.Angles(0, math.rad(120), 0)
Alright try CFrame.Angles(0, math.rad(60), 90) or CFrame.Angles(0, math.rad(120), math.rad90) or
CFrame.Angles(math.rad 90, math.rad(60), 0)
or CFrame.Angles(math?rad 90, math.rad(120), 0)
You could just copy the CFrame by printing it
Does this work?
local Button = script.Parent
local ClickDetector = Button.ClickDetector
local model = script.Parent.Parent.Parent.Parent
local TextLabel = script.Parent.Parent.Parent.Screen.CodeScreen.SurfaceGui.TextLabel
local HINGE_OFFSET = CFrame.new(3, 0, 0)
ClickDetector.MouseClick:Connect(function()
if TextLabel.Text == "696969" then
TextLabel.Text = "Access Granted! Opening Door..."
wait(2.9)
model:SetPrimaryPartCFrame(model:GetPrimaryPartCFrame() * HINGE_OFFSET * CFrame.Angles(0, math.rad(45), 0) * HINGE_OFFSET:inverse())
end
end)
SO CLOSEEEEEEEEEEE:
Hey uh… I’m going to sleep. You can still reply to me. But I won’t answer. Thanks!
Then it’s only the axis that was wrong!
try
model:SetPrimaryPartCFrame(model:GetPrimaryPartCFrame() * HINGE_OFFSET * CFrame.Angles( math.rad(45), 0, 0) * HINGE_OFFSET:inverse())
or
model:SetPrimaryPartCFrame(model:GetPrimaryPartCFrame() * HINGE_OFFSET * CFrame.Angles(0, 0, math.rad(45)) * HINGE_OFFSET:inverse())
Hey. Sorry for the late response. But I said i’m going to sleep. Here are the results:
First Method:
Second Method:
local HINGE_OFFSET = CFrame.new(-3, 0, 0)
model:SetPrimaryPartCFrame(
model:GetPrimaryPartCFrame() * HINGE_OFFSET * CFrame.Angles(0, 0, math.rad(45)) * HINGE_OFFSET:inverse()
)