Setting a Model Clone's Position

  1. Trying to set the position of a Model im copying from ServerStorage

Some images of the script, the position im getting and the error that follow.

1


3

  1. I have tried putting everything inside of a Part instead but that didnt work,

Hi!

To move models I would suggest using PivotTo. Also you’re trying to set your models CFrame, to a Vector3, which is not possible.

local PositionCFrame = CFrame.new(1,1,1) -- position

CrateClone:PivotTo(PisitionCFrame)
1 Like

The problem with your script is that you’re using Position [which is a Vector3 value] for cratePos. SetPrimaryPartCFrame requires a CFrame value, but instead, you’re giving SetPrimaryPartCFrame a Vector3 value.

To fix this, change cratePos to:

local cratePos = crate.PrimaryPart.CFrame

Also, I recommend you should use PivotTo instead of SetPrimaryPartCFrame, as @TortenSkjold mentioned, since it’s superseded now.

1 Like

As you can see in the scripts provided, i need the position of a Model already in workspace. So your sulotion is not viable.

1 Like

And i already tried this somehow earlier, didnt remember. The Model im trying to set the position of only spawns on the ServerStorage Model’s location… Not where cratePos is referring to and printing

1 Like

It is quite viable, we just need to edit it a bit. :slight_smile:


local PositionCFrame = ModelFromWorkspace:GetPivot()

CrateClone:PivotTo(PositionCFrame)

-- And the short version:
CrateClone:PivotTo(ModelFromWorkspace:GetPivot())
1 Like

Shows how new i still am, so many ways to do things! That worked, thank you so much :smiley:

1 Like