Only PrimaryPart of model moving

Hello, could someone help me fix my script please?

  1. What do you want to achieve? I want to clone 4 stages and teleport them to different coordinates on the map

  2. What is the issue? Only the PrimaryParts are moving, and using .Position to change the models’ position results in an error. Welding parts also doesn’t make them move together.

  3. What solutions have you tried so far? I have tried to search on DevForum for similar topics but almost all of them use TweenService, which I haven’t learned yet.

Relevant part of serverscript:

What is happening on the screen:

What is happening in the taskbar:

image

Original folder w. model:

image

Thanks for looking at this issue!

1 Like

I wouldn’t be setting the primary part position because it will only move that part. I would use

local pos = Vector.new() --- put your x y and z cords here
clonedstage:PivotTo(CFrame.new(pos))

This will explain what PivotTo() does! Goodluck!

4 Likes

Replace the line that directly sets the primaryparts position with this.

2 Likes

When you are using models you can use the :MoveTo function that takes a Vector3 as parameter

2 Likes

Tysm! Does PivotTo() basically move the center point of an object to the Vector3() given? (idk if i’m understanding the documentation correctly)

Btw sry if this is irrelevant but do you know why it is printing “PivotTo is not a valid member of CFrame”?

(relevant code)

1 Like

on the line

local stagecframe = clonedstage:GetPivot() -- your getting the cframe

but you are trying to pivot a cframe when it has to be a model

stagecframe:PivotTo(stagecframe * rotation) -- trying to pivot a cframe to a cframe

If your trying to make the clonestage have the position I would change stagecframe:PivotTo() to clonestage:PivotTo()

1 Like

the reason why you get the error is because PivotTo() only works on models.

" Transforms the PVInstance along with all of its descendant PVInstances such that the pivot is now located at the specified CFrame. This is the primary function that should be used to move Models via scripting."

1 Like

Ty, got it fixed now :smiley: (i put the rotations in the wrong order lol)