8ntlers
(antlers lol)
February 14, 2023, 3:47am
1
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
Dede_4242
(Dede_4242)
February 14, 2023, 3:51am
2
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
8ntlers
(antlers lol)
February 14, 2023, 3:52am
3
Thank you! I’ll try that rn!
Thank you! I’ll try that rn!
Thank you! I’ll try that rn!
DasKairo
(Cairo)
February 14, 2023, 3:53am
4
Testing the code, It works fine, are you sure this is the correct code?
2 Likes
8ntlers
(antlers lol)
February 14, 2023, 3:55am
5
awh, it says Unable to cast Vector3 to CoordinateFrame
8ntlers
(antlers lol)
February 14, 2023, 3:55am
6
Nothing else in the game uses MoveTo:
I can send a video of an overview of the game so you can understand better?
DasKairo
(Cairo)
February 14, 2023, 3:57am
7
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
jmesrje
(jmesrje)
February 14, 2023, 3:58am
8
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
8ntlers
(antlers lol)
February 14, 2023, 3:59am
9
Thank you so much! I really needed this, I appreciate all of you who tried to help
1 Like
8ntlers
(antlers lol)
February 14, 2023, 4:00am
10
Ah, I must’ve missed that. Thank you so much for helping!
8ntlers
(antlers lol)
February 14, 2023, 4:00am
11
Thank you so much for helping! Good day to you!
8ntlers
(antlers lol)
February 14, 2023, 4:01am
12
So if that’s the case, how would I be able to implement that information and change the code exactly?
jmesrje
(jmesrje)
February 14, 2023, 4:06am
13
Try removing the decimals and see if that works? I’m not entirely sure if vector3 takes floats.
1 Like
8ntlers
(antlers lol)
February 14, 2023, 4:19am
15
@jmesrje
I didn’t get any errors, but he didn’t move. Any ideas?