Help with easily swapping a model

Hello, I’m working on a game similar to PLS DONATE and I have different stands that the player can collect and use. I’m just having trouble with switching out the model for the new one since models don’t have a direct ‘Position’ and ‘Orientation’ value like parts do.

Something like this…

Destroy:
image

Clone Fall into the ‘1’ model (there will be more later)
image
image

And then adjusts its position and orientation to be the same as the stand that was just deleted.

You can try this (given that old stand is a model)

local OldStand = -- old stand
local NewStand = -- new stand
local OldStandCFrame = OldStand.CFrame -- cframe both holds position and orientation

OldStand:Destroy()
local Clone = NewStand:Clone()
Clone.CFrame = OldStandCFrame
Clone.Parent = game.Workspace.Stands.1

Use the Pivot property and call SetPivot

The old stand is model but I get this error:

Hello, sadly models dont have cframe, however, im unsure if you can do this,you can add a part called “main”, this will act as your cframe.

Use :GetPivot and :PivotTo()
Models are PVInstances so it should work.

local OldStand = -- old stand
local NewStand = -- new stand
local OldStandPivot = OldStand:GetPivot() -- cframe both holds position and orientation

OldStand:Destroy()
local Clone = NewStand:Clone()
Clone:PivotTo(OldStandPivot)
Clone.Parent = game.Workspace.Stands.1
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.