Good day,
I have the code below which spins and moves a part at the same time and working, what I am trying to do is not use Vector3 and use CFrame to move and roate the part.
When I change to CFrame part rotates but does not move, How do I rotate and move using CFrame only?
local part = script.Parent
local TweenService = game:GetService("TweenService")
local moveDist = 20
local spinSpeed = 1
-- Move using Vector3
local MoveInfo = TweenInfo.new(1, Enum.EasingStyle.Sine,Enum.EasingDirection.Out, -1, true, 0)
local MovePart = TweenService:Create(part, MoveInfo, {Position = Vector3.new(part.Position.X + moveDist, part.Position.Y, part.Position.Z)})
MovePart:Play()
-- Spin using CFrame
spininfo = TweenInfo.new(spinSpeed,Enum.EasingStyle.Linear)
Spin1 = TweenService:Create(part,spininfo,{CFrame = part.CFrame * CFrame.Angles(0,0,math.rad(120))})
Spin2 = TweenService:Create(part,spininfo,{CFrame = part.CFrame * CFrame.Angles(0,0,math.rad(240))})
Spin3 = TweenService:Create(part,spininfo,{CFrame = part.CFrame * CFrame.Angles(0,0,math.rad(360))})
Spin1:Play()
Spin1.Completed:Connect(function()Spin2:Play() end)
Spin2.Completed:Connect(function()Spin3:Play() end)
Spin3.Completed:Connect(function()Spin1:Play() end)