I'm wanting to move a model named 'crate' to the position of another part on the map, named 'crateSpawnLocationA'. SetPrimaryPartCFrame() does move the model, but not directly to the position of the part. Can someone please help me?
crate:SetPrimaryPartCFrame(crate:GetPrimaryPartCFrame() * CFrame.new (game:GetService("Workspace").crateSpawnLocationA.Position))
Well, it moves cause it works. What you did wrong is actually set the wrong PrimaryPart. You want to make sure the primary part is always the CENTER part. This ensures that the center is moved to that positions and everything else moves along with it.
I suggest you change the Primary Part of the Crate
also, a fixed script if you simply want to move the model to a part
crate:SetPrimaryPartCFrame(CFrame.new(game.Workspace.crateSpawnLocationA.Position))
You don't need the multiplication and also you don't need :GetService
on Workspace.
Either do workspace
or game.Workspace
.
Hopefully after doing all of this helped you solve your problem. If your script doesn't work Comment below your error if you have one or the issue you are having
Best of luck to you Developer!
You could try having the crate move Via; Vector3
game.Workspace.crate.Position = Vector3.new(Position)
If this doesn't work I wish you the best of luck.