Riddle me this, getchildren not working?

Alright so I am working on a cool visualizer for my game. I already have it working. I am working on a system on fetching the children. You’ll never believe it guys. It DOESN’T fetch the children!!

game.Loaded:Wait(2)
local parts = {}

local gridSize = 10
local partSize = Vector3.new(10, 1, 10)
local sineFrequency = 0.5 -- frequency of the sine wave
local amplitude = 0.25 -- amplitude of the sine wave

local TweenService = game:GetService('TweenService')
local SoundService = game:GetService('SoundService')
local RunService = game:GetService('RunService')

local sound = Instance.new('Sound')
sound.SoundId = 'rbxassetid://5410086218'
sound.Looped = true
sound.Parent = SoundService
sound.Volume = 0.07
sound:Play()

local oldPlaybackLoudness = (sound.PlaybackLoudness / 350)
local newPlaybackLoudness = (sound.PlaybackLoudness / 350)
local Visualizer = workspace:WaitForChild('Visualizer')

if Visualizer then
	print('Visualizer is not nil')
else
	print('Somehow visualizer is nil')
end

print(Visualizer:GetChildren())

for _, Part in pairs(Visualizer:GetChildren()) do
	print('running :>')
	local x, y = Part.Name:match("(%d)_(%d)")
	print(x, y)
	x = tonumber(x)
	y = tonumber(y)

	if x and y then
		parts[x][y] = Part
	end
end

image

The children CLEARLY aren’t nil and are still childed to that ‘Visualizer’ model.

2 Likes

It might be getting unloaded by streamingenabled, disable it or move the script to the server

1 Like

Yep that was the issue. It appears that StreamingEnabled somehow got turned on even though I manually disabled it when I first started working on the game. I would have never thought of that.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.