I tried using Motor6Ds to make an animation for it but when i use the animation editor, it looks really weird. All i want it to do is rotate 45 degrees. What is the best way for me to do this? Edit: and i don't just want it to teleport to the position, I want it to move towards it.
Using CFrame, you can rotate an object...
local Part = workspace:WaitForChild("Part") -- to account for latency local Rad = math.rad local function RotatePart(Object) Object.CFrame = Object.CFrame*CFrame.Angles(Rad(5),Rad(5),Rad(5)) end RotatePart(Part)
You can convert degrees to radians cleanly using 'math.rad()' ... or:
local radians = degrees * math.pi / 180
(:Lerp())
for i = 0, 1, .1 do Object.CFrame = Object.CFrame:lerp(Object.CFrame * CFrame.Angles(0,0,Rad(45)), i) end
I figured out myself that if I put little "hinges" on the corner of the door I can make the door be animated to move around the corner in a more realistic way.