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

:MoveTo() function isn't working?

Hello! I am making a game, and I am trying to test :MoveTo().

script.Parent.CarCover:MoveTo(-85.1, -0.8, 346.2)

Literally nothing happens. Yes, "script.Parent.CarCover" does exist and is a model. Nothing moves. CarCover does have a PrimaryPart. Does the anchored value matter in this case?

3 comments

0

I would give you more details, but I don't have any.

0

Are you sure this is happening (e.g., with a print immediately after)? Are you sure the script isn't starting before the model loads? Where was the model before the :MoveTo?

0

Thanks guys... I feel really stupid now because I knew that.

2 answers

✓ Accepted answer

##Problem

First off, it would help if you provided us an error with the script if there was one present. However, I was able to pick up on the issue fairly easily. You never used a Vector3 Value for the :MoveTo() function. Thus leaving the script to error stating the argument was invalid.


##Solution

All you have to do is put the numbers you provided with your script into the parenthesis of Vector3.new()

script.Parent.CarCover:MoveTo(Vector3.new(-85.1, -0.8, 346.2))

#####If this answer did not help, please post any error you may be receiving from Developer Console or Output. This would help us greatly in solving your problem.


######Hopefully this answer helped, if it did hit that upvote button. If this answered your question please hit Accept Answer to the right. If you have any questions, leave them in the comments below and I will get back to you.

2 comments

0

hey remember when i was first but your answer was correctly bolded using some admin stuff yet you still got accepted?

0

It's not my fault the asker chose my answer over yours. I just did some formatting on my answer which anyone can do. Try stackedit.io to see what your questions/answers look like in markdown or use the site preview function when asking questions.

Note

This function does work, just it is Vector3 missing

Solution

script.Parent.CarCover:MoveTo(Vector3.new(-85.1, -0.8, 346.2)

If it dosen't work then try another Awnsers.

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