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

How to rotate and move a union with a script?

Asked by 7 years ago

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
0
x, y, z values are read-only. RubenKan 3615 — 7y

1 answer

Log in to vote
1
Answered by 7 years ago
Edited 7 years ago

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.

0
Thank you I have found it also for the rotation so thanks robloxy0123 30 — 7y
Ad

Answer this question