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 5 years ago
Edited 5 years ago
1for i = 1,66666 do
2    Instance.new('Part')
3 
4end

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

01local function GenerateViewport(Table)
02    local Camera = Instance.new('Camera') -- Camera I dont want to parent it because it would be confusing
03 
04    for i,v in pairs(Table) do
05        local ViewportFrame = Instance.new("ViewportFrame")
06        ViewportFrame.Parent = script.Parent.Frame
07        ViewportFrame.CurrentCamera = Camera
08        ViewportFrame.BackgroundTransparency = 1
09        ViewportFrame.BorderSizePixel = 0
10 
11        v.Parent = ViewportFrame
12        v.CFrame = Camera.CFrame * CFrame.new(0,0,-5)
13        v.Anchored = true
14    end
15 
16 
17end

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 5 years ago

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

Ad

Answer this question