Vector3 Not Working

I’m trying to teleport the entire map far away. (I know this is sloppy, I’m new to scripting)
The script:

local Desert = game.Workspace.DesertMap

Desert.Position = Vector3.new(0,0,1000000)

I have a part with the model inside of it because I can’t use .Position on a model to move the map.
thing for devforum
Here’s the error:
another thing for dev forum
I’m probably missing something very obvious, but I’m new to scripting.

You’re having a whole model inside. I think you should use Weld to weld all the parts inside the model and set it CFrame, not Position.

1 Like

How would I go about doing that?

Use the WeldConstraint object or another non depricated weld object to combine your model. Then set a primary part to the model and use the function model:SetPrimaryPartCFrame(cframe parameter)

Ungroup the whole model, put all parts inside and use some Weld plugins to weld all the parts. I usually use Moon Animator because it have a EasyWeld which supports Motor6D.

set a primary part for the map

local Desert = game.Workspace.DesertMap
Desert.PrimaryPart = Desert.Part -- change it to something else
Desert:SetPrimaryPartCFrame(CFrame.new(0,0,100000))

Is there a way to just move the entire model itself instead of using 100+ Welds?

1 Like

I believe using SetPrimaryPartCFrame will orient the entire model but the model won’t stay together and move as a solid object.

You could just use the PivotTo method on the model.

How do I do that? (Once again, I’m new to scripting :slight_smile: )

local Desert = game.Workspace.DesertMap.DesertMap

Desert:PivotTo(CFrame.new(Vector3.new(0,0,1000000)))

Hello there, You can move a model by using this script inside it.

You can group your map and then put this script inside the model.

local Desert = script.Parent -- Location of the model

Desert:MoveTo(Vector3.new(0,0,1000000)) -- Makes it go to the position you want.

I hope this helps

1 Like

Thanks so much! This worked perfectly.

1 Like

No problem! Glad I could help!

Can I use this in an external script?
Example:

local Desert = game.Workspace.DesertMap

Desert:MoveTo(Vector3.new(0,0,1000000))

Sure you can!

  • the MoveTo() function doesn’t work on “parts”, it only works on models.
    If you want to move parts just use ‘Vector3’

When I do it I get this error:

Position is not a valid member of Model "Workspace.DesertMap"

Edit: I’m dumb, that’s a different line of code

1 Like

Oh, “instance.Position” can’t be used in models.

That’s why we use MoveTo() to move entire models.


  • Model:MoveTo() — If it’s a model then use this one.
  • Part.Position — If it’s a Part then use this one.
2 Likes