Converting Vector3s for MoveTo() into CFrames for SetPrimaryPartCFrame()

Im trying to make an rng room generator and i need this code to turn into CFrame code:

NewRoom:MoveTo(Vector3.new(EndofOldRoom.Position.X, 0.05, EndofOldRoom.Position.Z + NewRoom.Parameters.Size.Z/2))

I just need to know how to set this into CFrame format without messing with the function of the code.

Thanks! :smiley:

Replacing Vector3.new() with CFrame.new() should do it.

Alright, thanks for your help!

while true do
local NewRoom = Room:Clone()
local EndofOldRoom = OldRoom
NewRoom:MoveTo(Vector3.new(EndofOldRoom.Position.X, 0.05, EndofOldRoom.Position.Z + NewRoom.Parameters.Size.Z/2))
NewRoom.Parent = workspace
OldRoom = NewRoom
wait(0.5)
end

I’m not sure if this is what you want, but I can’t really comment on your post, so I’ll just make an answer:
NewRoom:SetPrimaryPartCFrame(CFrame.new(EndofOldRoom.Position.X, 0.05, EndofOldRoom.Position.Z + NewRoom.Parameters.Size.Z/2))