MoveTo changes the Y location to an unwanted value. The only option is SetPrimaryPartCFrame(), but this changes the orientation to an unwanted value. How should I proceed?
COMMUNITY QUESTION
How to SetPrimaryPartCFrame() while preserving rotation WITHOUT MoveTo?
2 answers
Give this a try:
model:SetPrimaryPartCFrame(CFrame.new(Vector3.new(0,0,0), model.PrimaryPart.Position))
5 comments
0
Change 0,0,0 to your wanted position of course.
0
ok
0
ok
0
Did it work?
0
This will move the model to the desired location, but it will be pointed towards its last location
To preserve orientation, you have to add a Vector3 to the current CFrame:
local cf = model:GetPrimaryPartCFrame()
model:SetPrimaryPartCFrame(cf + Vector3.new(x, y, z) - cf.Position)
Vector3.new(x, y, z) - cf.Position gets the difference between where you want it and where it currently is. We add that difference to the current CFrame to get the correct position without changing orientation.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
What is your code?