EDIT:[Sorry for not being specific] I am basically rotating a part on the Y axis using the C0 and C1 properties of a motor weld.
I have two parts connected with a motor weld and would like to smoothly rotate the CFrame (Or C0 if you will) using some type of lerp, the wiki stated Vector3:Lerp, but how would I use it in CFrame.Angles? One conductor is CFrame.fromAxisAngle, but I have no idea how to use that. And bodygyro's are out of the picture. If you have any other method, ideas would be appreciated.
Thanks.
EDIT2: This apparently rotates the part way over 360 degrees when it should rotate only 90 as you stated.
local cframe = script.Parent.CFrame -- our starting cframe
local startRotation = 0
local endRotation = 0.5*math.pi
function lerp(start, finish, alpha)
return start + (finish - start)*alpha
end
function getYRotatedCFrame(cframe, startRotation, endRotation, alpha)
return cframe*CFrame.Angles(0, lerp(startRotation, endRotation, alpha), 0)
end
for index = 1, 100 do
script.Parent.CFrame = getYRotatedCFrame(script.Parent.CFrame, startRotation, endRotation, index / 100)
wait(0.03)
end
EDIT3: the index part of the code should be
for i = 1, 100 do
script.Parent.CFrame = CFrame.Angles (0,lerp(startRotation, endRotation, i / 100),0) + script.Parent.Position
wait()
end
making it equal to the angles will give you the exact rotation desired. BTW, I dont see the need for the second function.
Working code:
local startRotation = math.rad(0)
local endRotation = math.rad(90)
function lerp(start, finish, alpha)
return (finish - start)*alpha
end
for i = 1, 100 do
script.Parent.CFrame = CFrame.Angles (0,lerp(startRotation, endRotation, i / 100),0) + script.Parent.Position
wait()
end

3 comments
What exactly do you want to do with it? What are you trying to do? Please be more specific.
Better?
Yes, thank you