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

How to assign a Rotation(easy question) ?

Asked by
lyxture 27
7 years ago
game.Workspace.Baseplate.Rotation.X = 1

somehow this doesn't work

12:19:23.542 - X cannot be assigned to

1
You don't need the "X". Just do "workspace.Baseplate.Rotation = 1" FiredDusk 1466 — 7y

1 answer

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
7 years ago
Edited 7 years ago

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
)
0
thanks for the direct answer unlike @FiredDusk lyxture 27 — 7y
Ad

Answer this question