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

MoveTo Function is slightly off? [Solved using SetPrimaryPartCFrame() instead]

Asked by 9 years ago

I don't really know why the script I have will not work. All that is happening currently is a model (3 parts) is being moved from one position to another, it appears to be slightly off, the position it should actually be an exact fit (I wouldn't need to use Translate). I set this model in place before using the script, then I copied to position the PrimaryPart (Already set it) is at and pasted it in the code. Here is my SCRIPT inside of the model:

function Move()
    local Model = script.Parent
    Model.PrimaryPart = Middle
    Model:MoveTo(Vector3.new(-25,22.5,-14.5))
end

Move()

Now obviously, the new position should be -25,22.5,-14.5 but actually when I go to the primary part and look at the position, I get -25, 23.5, -14 instead. Is this not moving the PrimaryPart correctly or...? I can provide more information if needed, I don't believe more should be required.

0
There can't be a grid for MoveTo? Mainly because the Y axis has a decimal too, even though it's added by 1(WholeNumber) alphawolvess 1784 — 9y
0
Try checking results from roblox's xml model file. FieryEvent 185 — 9y
0
Is this a model or a Part? if it was a part you could do Model.Position = Vector3.new(-25,22.5,-14.5) However if it is a model, to check its position I would assume you would check the properties of a part in the model. But if you are using another method I am not sure. minikitkat 687 — 9y
0
@minikitkat, it's a Model. I'm using MoveTo function which should move the PrimaryPart and everything around it to the relative position of PrimaryPart. alphawolvess 1784 — 9y
View all comments (3 more)
0
@oioiamigos, Where/how would I do that? I believe I've heard of what you're talking about but a bit confused. alphawolvess 1784 — 9y
0
I had this same problem! I made an entire set of different objects (same shape and size) and was scripting to move the but ONE of them never went to the right spot. So I just created another value to adjust for it BSIncorporated 640 — 9y
0
What do you mean, Another value? Like changing it multiple times? alphawolvess 1784 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Since its a model pick a part and use MoveTo(game.workspace.ModelName.PartName.Position)

0
This didn't change anything. The location is still off. alphawolvess 1784 — 9y
0
By how much? BinaryResolved 215 — 9y
0
The same as in my question. alphawolvess 1784 — 9y
Ad

Answer this question