What do you want to achieve? Keep it simple and clear!
I am trying to rotate a door (part) on an attachment.
What is the issue? Include screenshots / videos if possible!
It is a Rust Building System and the door comes from replicated storage from a script, but when i click on it, the door moves positions to where it would originally be in replicated storage, not at its current position. Here’s a video :
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried Devforum and YT
Heres my simple code to rotate it
local door = script.Parent.Parent
local attachment = script.Parent.Parent.DoorSnapAttachment
function OpenDoor()
door.CFrame = CFrame.Angles(0,90,0)
end
script.Parent.MouseClick:Connect(function()
OpenDoor()
end)
You need to make the door into a model, with the primary part set to a part which is on the side of the door to act like a hinge. Anchor the hinge part and unanchor the door part, and create a weld constraint between the hinge part and the door part. Then instead of modifying the cframe of door modify the cframe of the hinge part.
I kinda cant make another part in the situation im in, cus of the way the placement system is made, I need it to rotate on an attachment, there is one attachment in the door and another attachment in a doorframe and both attachments are at the same position