Unable to cast double to Vector 3

Hello Developers, I had this bug when I was trying to move a model to a certain position. Heres the line of code:

game.workspace["Cave Dweller"]:MoveTo(Vector3.new(-55.307, 8.072, -21.427))

The error reads:

Unable to cast double to Vector 3

Thanks, -8ntlers

Have you tried CFrame.new()? If that doesn’t work is what you are trying to move a part or model? If it’s a model then you gotta use PivotTo() if I’m not wrong, and I also heard that MoveTo() is deprecated, not sure tho

1 Like

Thank you! I’ll try that rn!
Thank you! I’ll try that rn!
Thank you! I’ll try that rn!

Testing the code, It works fine, are you sure this is the correct code?

2 Likes

awh, it says Unable to cast Vector3 to CoordinateFrame

Nothing else in the game uses MoveTo:
I can send a video of an overview of the game so you can understand better?

I made sure to test these with functions:

Model = script.Parent
Model:MoveTo(Vector3.new(-55.307, 8.072, -21.427)) -- works

Model:PivotTo(CFrame.new(-55.307, 8.072, -21.427)) -- works
2 Likes

Well, library.fiveable.me says:

An int is an integer, which you might remember from math is a whole number. A double is a number with a decimal . The number 1 is an integer while the number 1.0 is a double

1 Like

Thank you so much! I really needed this, I appreciate all of you who tried to help

1 Like

Ah, I must’ve missed that. Thank you so much for helping!

Thank you so much for helping! Good day to you!

So if that’s the case, how would I be able to implement that information and change the code exactly?

Try removing the decimals and see if that works? I’m not entirely sure if vector3 takes floats.

1 Like

@jmesrje

I didn’t get any errors, but he didn’t move. Any ideas?