Moving part regardless of it's rotation?

How would I move a part regardless of it’s rotation. Say I had to move a part 5 studs upwards but it was rotated on its x/z axis, how would I move it up keeping its rotation as well?

2 Likes

If you are moving relative to world space, i.e setting the position of the part in a script. Then the part would still move up 5 studs no matter the rotation.

2 Likes

you would just add the Vector3 amount instead of multiplying it by the CFrame
game.Workspace.Part.CFrame = workspace.Part.CFrame+Vector3.new(0,5,0)

3 Likes

Just do something like:

Part.Position = Part.Position + Vector3.new(0, 5, 0)

Setting the Position of the part doesn’t affect the rotation of the part at all.

1 Like

Yeah I figured, I was trying to set the cframe but setting the world position of the part worked, thanks.