How to move a model

Just do this

local part = workspace.Model.PrimaryPart
local part2 = workspace.Whatever
local offset = Vector3.new() -- Keep it how much far you want your model to be from the other block

part.Position = part2.Size + offset
2 Likes

But the model also contains other parts, I want to not only move the primary part but I also want to move the other parts in the model. How do I do that?

1 Like

The whole model will move with a PrimaryPart, basically when you’re moving a PrimaryPart, the whole model moves.

1 Like

That example @Moneypro456789 provided its for moving a model directly into another part with an offset.
Your question seems like, you want to move the model to a specific coordinate and overlapping a part if its one there, not using an offset, you are already getting an offset when the model gets pushed upwards because its colliding with a cube.

Theres no way to overlap parts that has CanCollide true, only if those parts are Anchored true or CanCollide false. (or using collision groups)

1 Like

If you mean in-studio, you can untick the collisions checkmark in the topper, but if you mean via scripts, you can do Model:PivotTo(CFrame)

1 Like

Everything above should be answering your question. Also, this thread is already answered by Moneypro456789, so why not mark it as solution?

2 Likes

You need to weld the children of the model to the primary part too

1 Like

Nope, if it’s anchored, no need.

1 Like

Hmm…I actually also didn’t understand his question correctly, I just guessed it and that’s what he was looking for, luckily.

1 Like

this doesn’t move the model, it only moves the primary part, so I removed the solution tag. How do I move the entire model to a position or cframe?

1 Like

whats your model? like a character? its welded somehow? it has motors or welds?

1 Like

@Moneypro456789 was a bit right.
Model would move with PrimaryPart, just like character model which containts HumanoidRootPart aka PrimaryPart!
You might have to use :SetPrimaryPartCFrame() since it moves PrimaryPart with the model itself.

2 Likes

So as @MrSonic2746 suggested,

local part = workspace.Model
local part2 = workspace.Whatever
local offset = Vector3.new() -- Keep it how much far you want your model to be from the other block

part:SetPrimaryPartCFrame(CFrame.new(part2.Size + offset))

my model has a primary part that is anchored, and another part that is not anchord but is welded with weld cntraint to the primary part. SetPrimaryPartCFrame, PivotTo, and MoveTo all works, but iif there is somehing in the way, then it won’t go to the exact location i want it to be. I want to make it overlap another part that can collide but it won’t overlap. Setting the primary part’s position only moved the primary part and didn’t move the model.

1 Like

Ok, but from next time, do check before actually marking as a solution.

1 Like

But, SetPrimaryPartCFrame is kinda deprecated

Documentation suggest using PivotTo()

1 Like

The thing is if there is another part in the way, the model won’t overlap but will instead be pushed from the target position because of cocllision. Both parts are anchored though and I want them to overlap

As you suggested

local part = workspace.Model
local part2 = workspace.Whatever
local offset = Vector3.new() -- Keep it how much far you want your model to be from the other block

part:PivotTo(CFrame.new(part2.Size + offset))

Dude, this natural pushing isn’t in our hands, it’s all Roblox physics. We can maybe make a tweened pushing but that isn’t natural.

I already explained that situation