Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Need help with a Rotating Radians script?

Asked by 8 years ago

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

Log in to vote
1
Answered by 8 years ago

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))
0
Also for those who need to do a loop Type while wait () do then the part.CFrame... then after that type end :) sammy52520 45 — 8y
Ad

Answer this question