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

Is it safe not parenting the camera anywhere?

Asked by 4 years ago
Edited 4 years ago
for i = 1,66666 do
    Instance.new('Part')

end

I was wondering when I did Instance.new and not parenting them where do they go

I was wondering if this would put stress on the server and lag it

the main problem i had was

local function GenerateViewport(Table)
    local Camera = Instance.new('Camera') -- Camera I dont want to parent it because it would be confusing

    for i,v in pairs(Table) do
        local ViewportFrame = Instance.new("ViewportFrame")
        ViewportFrame.Parent = script.Parent.Frame
        ViewportFrame.CurrentCamera = Camera
        ViewportFrame.BackgroundTransparency = 1
        ViewportFrame.BorderSizePixel = 0

        v.Parent = ViewportFrame
        v.CFrame = Camera.CFrame * CFrame.new(0,0,-5)
        v.Anchored = true
    end


end

This would still work even when the camera wasn't parented to anything But is this recommended? I was wondering if the camera is automatically destroyed or it dosen't exist at all therefore preventing client lag

Does this all stack up and cause problems later on?

Do I still need to destroy the camera?

1 answer

Log in to vote
0
Answered by 4 years ago

This won't affect it if you parent it back to where it should be.

Ad

Answer this question