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

How to assign a Rotation(easy question) ?

game.Workspace.Baseplate.Rotation.X = 1

somehow this doesn't work

12:19:23.542 - X cannot be assigned to

1 comment

1

You don't need the "X". Just do "workspace.Baseplate.Rotation = 1"

1 answer

✓ Accepted answer

The X, Y and Z values are read only, you can't directly set those values. The way you can get around this is doing the following:

local Part = workspace.Baseplate

--Set rotation
Part.Rotation = Vector3.new(
	1,
	Part.Rotation.Y,
	Part.Rotation.Z
)


--Keep Y and Z
Part.Rotation = Vector3.new(
	1,
	0,
	0
)

--Or for increasing / subtracting etc.
Part.Rotation = Vector3.new(
	Part.Rotation.X + 1,
	Part.Rotation.Y - 1,
	Part.Rotation.Z * 2
)

1 comment

0

thanks for the direct answer unlike @FiredDusk

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