Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I change the orientation of a block using a button?

So I have a model with a primary part. I can change the CFrame perfectly. But I'm trying to figure out how to change Orientation, Here is the script I have.

local float = workspace:WaitForChild("Float1")
local targetcframeup = CFrame.new(67.761, 11.58, -12.985)

script.Parent.ClickDetector.MouseClick:Connect(function()
	for i = 0,800,.01 do
    	local cf = float.PrimaryPart.CFrame:Lerp(targetcframeup,i)
    	float:SetPrimaryPartCFrame(cf)
    	wait(.01)
	end
end)

1 answer

✓ Accepted answer

It's really easy, all you have to do is change CFrame.new to CFrame.Angles, and include math.rad , a bit like this:

local targetcframeup = CFrame.Angles(math.rad(67.761), math.rad(11.58), math.rad(-12.985))

No problem, if you have any questions friend me on discord: Haunted#5196

This discussion is preserved as it was. New answers, comments, and votes are closed.