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

How do i add to only 1 coordinate of a CFrame?

Hi again! I was wondering how i would go about adding a number (334.464) to only one coordinate of a CFrame. I am trying to make a "infinite corridor" by cloning the model of the corridor and then moving the clone. I don't want the players to see the corridor moving obviously. Does anyone have any ideas? Current script below:

local pos = CFrame.new()
while true do
	wait(12)
	local infgen = game.Workspace:FindFirstChild("original"):Clone()
	infgen.Name = "notorig"
	infgen:SetPrimaryPartCFrame(1,1,1)
	infgen.Parent = game.Workspace
end

1 answer

✓ Accepted answer

It should work like that:

local part = workspace.Part
local newPart = Instance.new("Part", workspace)
newPart.Name = "Something"

newPart.CFrame = part.CFrame * CFrame.new(1, 0, 0) -- Moves a bit more far than part

2 comments

0

Hmm, seems to only increase the cframe by the number from the original model. do you know how i could make it so that it keeps going on so it goes from the original to the next, ect.

0

basically be infinitely longer?

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