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

Need help with a Rotating Radians script?

So the part that I am wanting to rotate is named Drum in workspace and I was wondering if I can have help because I it is just not working. Here is the script. I was also planning on tieing to a button.




local part = Instance.new('part')
part.Parent = Workspace
part.Anchored = true
part.CFrame = part.CFrame * CFrame.Angles(9, math.pi, 180

Also if it helps, I also have the Drum on it's side Like and washer where it washed horizontally. Thank you.

1 answer

✓ Accepted answer

CFrame.Angles works in radians, not degrees.

To convert, use the math.rad function, so:

To convert 180 degrees to radians, do:

math.rad(180)

So for your script, use:

local part = Instance.new('Part')
part.Parent = Workspace
part.Anchored = true
part.CFrame = part.CFrame * CFrame.Angles(math.rad(9), math.pi, math.rad(180))

and for your drum:

local part = workspace.Drum
part.CFrame = part.CFrame * CFrame.Angles(math.rad(9), math.pi, math.rad(180))

1 comment

0

Also for those who need to do a loop Type while wait () do then the part.CFrame... then after that type end :)

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