Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

MoveTo rounding

Asked by 11 years ago

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?

0
Use CFrame Azgarok 3 — 10y

1 answer

Log in to vote
0
Answered by
User#3 0
11 years ago

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)
Ad

Answer this question