function movemodel() if model then mouse.TargetFilter = model end if isequipped == true and mouse.Target.Name == "NutrientPart" then local mousepos = mouse.Hit.p model:SetPrimaryPartCFrame(CFrame.new(mousepos)) end end
this function moves a model around as it is supposed to do but I ran into a slightly annoying problem.
another function rotates the model while this one just moves it around, but I noticed that when I move the model after I rotate it, the model does not keep its rotation that was set but rather re-aligns back to before it was rotated. I suspect this is because setting the position does not keep the rotation like CFrame does. how can I keep its current LookVector and still apply it to a position?
PS, I tried using just CFrame to move the model but doing this with the mouse makes it use the mouses LookVector which is undesirable.
Multiply by the current angle
angle = CFrame.Angles(0,90,0) model:SetPrimaryPartCFrame(CFrame.new(mousepos) * angle)