Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

MoveTo rounding

Asked by 6 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?

2 answers

Log in to vote
1
Answered by 6 years ago

Use CFrame

Ad
Log in to vote
0
Answered by
Zyneak 130
6 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)

Answer this question