How would I prevent Model:MoveTo() from moving an unanchored model too high? [read to understand]

For example, if I call Model:MoveTo(a position underneath a tree) it will move the model to the top of the tree where I want it underneath at the exact point.

Can’t really find a solution. Anyone got anything?

Use a newer method, such as PivotTo or SetPrimaryPartCFrame. I can’t verify if these won’t avoid overlapping objects, but they should do as you asked.

MoveTo behaves like this because it’s from an era where the game was about building with LEGO-esque bricks, and bricks generally don’t clip/overlap into each other.
It’s useful for teleporting players, they will not appear inside obstructions or other players that happen to be at the destination.

1 Like

Cool, I’ll check this out later. Thx.

PlrCharacter:PivotTo(Prompt.Parent.Parent:GetPivot())

This doesn’t seem to move to character, could you write the code?

1 Like

Just use SetPrimaryPartCFrame (assuming you already have a PrimaryPart set inside of your model)

Example:

local model = game.Workspace.Model --example model inside of workspace
model:SetPrimaryPartCFrame(CFrame.new(0,2,5)) --positions the model at x: 0, y: 2, z: 5
2 Likes