Roblox Script Change the position of a Model
Posted on April 26, 2020
Changing a position of a Part it's about using Position
property.
Doing the same for a Model, is not going to work.
We need to alter the CFrame
property instead using a specific method:
workspace.MyModel:SetPrimaryPartCFrame( CFrame.new(0,100,-30) )
If we want to move the model, we can compute the new position with an operation:
local model = workspace.MyModel
local cpos = model.PrimaryPart.Position
wait(5)
local npos = CFrame.new(cpos + Vector3.new(0,0,-100))
model:SetPrimaryPartCFrame( npos )