Cframe expected got table is the error. Im making a game where you can click on an object and move it; im trying to include the ability to rotate it clockwise and counterclockwise but it still insists on not working , if you could help me in answers please do. Thankyou
game:GetService("UserInputService").InputBegan:Connect(function(input,gameprocessed)
if input.KeyCode == Enum.KeyCode.Q then
local X,Y,Z = mtarget.CFrame:toEulerAnglesXYZ()
--// if key q is pressed then rotate CC
mtarget.CFrame = CFrame * CFrame.Angles(math.rad(X),math.rad(Y+90),math.rad(Z))
end
end)
game:GetService("UserInputService").InputBegan:Connect(function(input,gameprocessed)
if input.KeyCode == Enum.KeyCode.E then
local X,Y,Z = mtarget.CFrame:toEulerAnglesXYZ()
--// if key e is pressed then rotate C
mtarget.CFrame = CFrame * CFrame.Angles(math.rad(X),math.rad(Y-90),math.rad(Z))
wait()
end
end)
mtarget ; mouse target / what player has clicked and is in control of rotating the object.

1 comment
i think u need to do CFrame = CFrame.new() and then continue on