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

Rotation set to 180 but doesnt work?

The rotation that is set to 180 does not work and I don't know why. Can i get help?

local Rotate = 0
local Number = math.random(1,2)
local Block = script.Parent

if(Number == 1) then
	Rotate = 0
else
	Rotate = 180
end

Block.Rotation = Vector3.new(math.rad(Rotate),0,0)

1 comment

0

it turns but not 180

2 answers

There is no property called "Rotation" on a Part.

Change

Block.Rotation= Vector3.new(math.rad(Rotate),0,0)

to

Block.Orientation = Vector3.new(math.rad(Rotate),0,0)

1 comment

0

This is incorrect. BasePart DOES have a rotation property, and using orientation WON'T fix it, because orientation is also in DEGREES.

Rotation is "The rotation of the part in degrees for the three axes." The issue here is that you are converting your degrees to radians, but rotation is in degrees. The solution here is to simply remove the radian conversion (math.rad).

Block.Rotation = Vector3.new(Rotate,0,0)

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