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

How to rotate and move a union with a script?

Hello, I want to make a script that you can use to move and rotate a union so that it wil decrease the amount of position of the union on the x. here is what i have.

game.Workspace.Part.CFrame.x = game.Workspace.Part.CFrame.x - 4

1 comment

0

x, y, z values are read-only.

1 answer

✓ Accepted answer

Try:

game.Workspace.Part.CFrame = game.Workspace.Part.CFrame + Vector3.new(-4, 0, 0)

This translates the CFrame by -4 on the x axis. When you use the + operator on a cframe, and provide a Vector3 it will "add" the vector3 to the CFrame.

1 comment

0

Thank you I have found it also for the rotation so thanks

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