Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 2 years ago

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

Log in to vote
1
Answered by
SuperPuiu 497 Moderation Voter
2 years ago

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
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. Mrpolarbear2games 55 — 2y
0
basically be infinitely longer? Mrpolarbear2games 55 — 2y
Ad

Answer this question