How to Rotate Part script “unscrewing”

I am trying to figure out how to make the lid of my Martian Cylinder to Unscrew. I gotten the main part of the script finshed and the lid is held on by a weld constant. I tried Cfame again and Vector3 but it didn’t work it made the lid teleport under the map. The video in the bottom is what I am trying to achieve.

image

Try using hinges, it works very smoothly. To make hinges work you’ll need to attach two attachments to the center of the two parts. Then in the hinge constraint, change the ActuatorType to Motor. Finally in the Motor Properties, change the AngularVelocity to the speed you want to. Hope this helps.

Edit: Also make sure the spinning part isn’t anchor or it will not spin.

1 Like

You just need to use object-space transformations. Like this

local rs: (RunService) = game:GetService("RunService")
local lid: (BasePart) = script.Parent

while rs.Heartbeat:Wait() do
	lid.CFrame = lid.CFrame * CFrame.fromAxisAngle(Vector3.new(1,0,0), math.pi/100) * CFrame.new(0.01,0,0) 
end
1 Like

Thank you very much. Would you have any ideals what’s happening to my script in my other post? Cframe Works In Studio, But frozen in game - #5

Actually This is a lot more better then the other one. Thank you for the help.
https://gyazo.com/7575a068f59fba295f7686980ce93eab