Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I move a model to a different position?

Here is my script. It only moves the primary part and not the whole model. How do I fix this?

local floor1pos = Vector3.new(1.6, 153.3, -34.4)

function NewTower()
	print("Started")
	local Floor1 = floors[math.random(1, #floors)]:Clone()
	print("Cloned")
	Floor1.PrimaryPart = Floor1.Platform
	Floor1:SetPrimaryPartCFrame(CFrame.new(floor1pos))
	print("Set Primary Part")
	Floor1:MoveTo(floor1pos)
	print("Moved")
	Floor1.Parent = workspace
	print("Switched Parent")
	
	
end

NewTower()



1 comment

0

try using :MoveTo() on the model

1 answer

local model = script.Parent
model:MoveTo(Vector3.new(0, 10, 0)) -- move 10 studs up in the y-axis from the origin
model:SetPrimaryPartCFrame(CFrame.new(0, 20, 0) * CFrame.Angles(0, math.rad(45), 0)) -- move 20 studs in the y-axis from the origin and rotate 45 degrees in the y-axis

This discussion is preserved as it was. New answers, comments, and votes are closed.