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

How to edit only the cframe's position?

Hello, I am trying to move a part to a certain position and I want the orientation and all other properties of CFrame to be the same besides CFrame.p How would I do this? (And no, I cannot just change the vector3 because i am moving the part into another part.)

1 comment

0

This is not possible you will have to change the cframe, you can not change one part of it.

2 answers

✓ Accepted answer

The easiest way is to use 2 vector3s in the cframe.new function example:

workspace.Part.CFrame = CFrame.new(Vector3.new(0,10,10), workspace.Part.Orientation)

this should set the position of workspace.Part to 0,10,10 and keep its orientation

3 comments

0

When you edit the orientation it works like vector3, making sure that the part is not inside another part. So when I try to do this, it moves the part correctly, but then to fix the orientation puts it above the part it is supposed to be inside.

0

im editing the orientation via cframe so it shouldnt do that

0

i tested it and it works fine

game.Workspace.Part.CFrame = CFrame.new(Vector3.new(X, Y, Z))

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