Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

MoveTo rounding

Workspace.Model:MoveTo(Vector3.new(0,0.3,0))

When I make a model with 1 part in it and use that code in the command bar it moves the part to 0,.4,0. Is there any way to get around the rounding?

1 comment

0

Use CFrame

1 answer

That is because of how collisions work.

What I do is check how off it is and then use the TranslateBy method to offset it.

This will move it regardless of other parts in the way. Please note though it is relative, you're not setting the position.

Here's an example. Say I want to move model to 0,0.4,0. I should note the PrimaryPart should be set.

model:MoveTo(0,0.4,0)
model:TranslateBy(0,(0.4-model.PrimaryPart.Position.Y),0)

This discussion is preserved as it was. New answers, comments, and votes are closed.