I'm trying to use SetPrimaryPartCFrame to move a model without affecting it's current rotation values and anything there after. Is there a method or way to just move it's x,y,z without changing it's rotation or anything?

I've got it moving to where the mouse is, but it completely resets the way is was rotated.

model:SetPrimaryPartCFrame(CFrame.new(mouse.Hit.p)) 

And on a side note, is it possible to add say like +10 on the mouse Y position it sends through mouse.Hit.p? Because my models end up half way in the floor.

I've tried searching online but nobody else has come across this.

1 comment

0

CFrames are position and rotation. You're currently constructing a new CFrame out of the Hit's position. You should be able to preserve rotation by just doing model:SetPrimaryPartCFrame(mouse.Hit)