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

[SOLVED]What is wrong with this :MoveTo() function, its to do with moving a model?

Error 19:46:29.024 - Players.Olinator21.PlayerGui.A-Chassis Interface.Flip:17: invalid argument #1 (Vector3 expected, got Instance) This is a flip script for a car and I want the car to move up 25 studs whats wrong?

local skeleton = game.Workspace.Skeleton
skeleton:MoveTo(skeleton + Vector3.new(0,25,0))

[SOLVED VERSION]

local skeleton = game.Workspace.Skeleton
skeleton:MoveTo(Vector3.new(0,100,0) + skeleton.PrimaryPart.Position)

1 answer

✓ Accepted answer

Skeleton is your model, not a position. To get the position of the model you could either use GetBoundingBox or GetPrimaryPartCFrame. GetBoundingBox will return the exact center as well as the size of the model, while GetPrimaryPartCFrame will return the PrimaryPart's CFrame. It's really up to you on what you use, but these are your options.

2 comments

0

model:MoveTo() works fine as well, and it's not deprecated.

0

Nothing I said is deprecated? I was also stating ways to get the actual position of a model, not move it.

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