How would i make a model rotate 90 degrees to the right when i press r.
here is what i have already:
PlayerMouse.KeyDown:connect(function(key) if key == "r" then if Clone.MovedValue.Value == false then local model = Clone.Model model.PrimaryPart = model.Center1 local cframe = model.PrimaryPart.CFrame -- Current CFrame model:SetPrimaryPartCFrame(cframe * CFrame.new(0, math.rad(90), 0)) end end end)
So far it moves it up and doesn't rotate.
You can multiply by the CFrame.Angles
constructor in order to orientate the model.
local cframe = model.PrimaryPart.CFrame model:SetPrimaryPartCFrame(cframe * CFrame.Angles(0, math.rad(90), 0))