Audio Visualizer not working properly

I am trying to add speakers to my new game but…

Before (Not Active):


After (Active):
https://i.gyazo.com/05611828e068b8b929e6a7d68425365d.mp4
Can someone tell me how to fix it or give me a new script to work with? Because I don’t have a clue on what’s going on…

Can’t give you whole scripts but you could be directed on how to fix this for yourself. That’s assuming this is your code and you understand everything that’s happening here, otherwise it won’t be very helpful or you might not understand the proposed fixes as well.

Please share more details about the problem, including code snippets that you’ve identified to be part of the problem, if you’re looking for help.

No I don’t code… I got it from this guy How To Make Audio Music Visualizer Parts In Roblox Studio 2021 | Vibe Game Series (PT.20) - YouTube

Location:
image
Code:

Location:
image
Code:



image
Is this good?

Not really. It would be more helpful if you posted the actual code on the thread rather than images so it’s easier to select text and go through the script. That being said: there’s still not enough detail here. It would help if you could narrow down the exact piece of code that you need help with, rather than posting all of your code.

Additionally, since you don’t code, it’ll be a lot more difficult to offer you suggestions as to how to fix this without you actually understanding what’s being sent and on top of that, not being the one who wrote the code. It’s better if you ask for that support from the person who wrote the code instead. I do recommend some research such as through the Developer Hub to pick up a few things.

Well I don’t know what’s wrong with the code! I don’t think that there is anything wrong with it! I don’t think I can use this code because it probably only is able to do the speakers on the y axis… Maybe I just need new code…
Code:
local part = game.Workspace.Audios.Audio
local part2 = game.Workspace.Audios.Audio2
local part3 = game.Workspace.Audios.Audio3
local part4 = game.Workspace.Audios.Audio4
local part5 = game.Workspace.Audios.Audio5
local part7 = game.Workspace.Audios.VIBESIGN.part
local part8 = game.Workspace.Audios.VIBESIGN.part2
local part9 = game.Workspace.Audios.VIBESIGN.part3
local part10 = game.Workspace.Audios.VIBESIGN.part4

local sizex = part.Size.X
local sizez = part.Size.Z
local positiony = part.Position.Y
local positionx = part.Position.X
local positionz = part.Position.Z

local sizex2 = part2.Size.X
local sizez2 = part2.Size.Z
local positiony2 = part2.Position.Y
local positionx2 = part2.Position.X
local positionz2 = part2.Position.Z

local sizex3 = part3.Size.X
local sizez3 = part3.Size.Z
local positiony3 = part3.Position.Y
local positionx3 = part3.Position.X
local positionz3 = part3.Position.Z

local sizex4 = part4.Size.X
local sizez4 = part4.Size.Z
local positiony4 = part4.Position.Y
local positionx4 = part4.Position.X
local positionz4 = part4.Position.Z

local sizex5 = part5.Size.X
local sizez5 = part5.Size.Z
local positiony5 = part5.Position.Y
local positionx5 = part5.Position.X
local positionz5 = part5.Position.Z

game:GetService(“RunService”).RenderStepped:Connect(function()

local loudness = game.Workspace.Sound.PlaybackLoudness
local sizeincrement = loudness/60

part.Size = Vector3.new(sizex, sizeincrement, sizez)
part.Position = Vector3.new(positionx, positiony + (sizeincrement/2), positionz)

part2.Size = Vector3.new(sizex2, sizeincrement, sizez2)
part2.Position = Vector3.new(positionx2, positiony2 + (sizeincrement/2), positionz2)

part3.Size = Vector3.new(sizex3, sizeincrement, sizez3)
part3.Position = Vector3.new(positionx3, positiony3 + (sizeincrement/2), positionz3)

part4.Size = Vector3.new(sizex4, sizeincrement, sizez4)
part4.Position = Vector3.new(positionx4, positiony4 + (sizeincrement/2), positionz4)

part5.Size = Vector3.new(sizex5, sizeincrement, sizez5)
part5.Position = Vector3.new(positionx5, positiony5 + (sizeincrement/2), positionz5)


if loudness >= 50 then
	
	part.Material = "Neon"
	part.BrickColor = BrickColor.new(0.160784, 0.313725, 1)
	part2.Material = "Neon"
	part2.BrickColor = BrickColor.new(0.160784, 0.313725, 1)
	part3.Material = "Neon"
	part3.BrickColor = BrickColor.new(0.160784, 0.313725, 1)
	part4.Material = "Neon"
	part4.BrickColor = BrickColor.new(0.160784, 0.313725, 1)
	part5.Material = "Neon"
	part5.BrickColor = BrickColor.new(0.160784, 0.313725, 1)
	part7.Material = "Neon"
	part7.BrickColor = BrickColor.new(0.160784, 0.313725, 1)
	part8.Material = "Neon"
	part8.BrickColor = BrickColor.new(0.160784, 0.313725, 1)
	part9.Material = "Neon"
	part9.BrickColor = BrickColor.new(0.160784, 0.313725, 1)
	part10.Material = "Neon"
	part10.BrickColor = BrickColor.new(0.160784, 0.313725, 1)
	
else
	
	part.Material = "Plastic"
	part.BrickColor = BrickColor.new(0,0,0)
	part2.Material = "Plastic"
	part2.BrickColor = BrickColor.new(0,0,0)
	part3.Material = "Plastic"
	part3.BrickColor = BrickColor.new(0,0,0)
	part4.Material = "Plastic"
	part4.BrickColor = BrickColor.new(0,0,0)
	part5.Material = "Plastic"
	part5.BrickColor = BrickColor.new(0,0,0)
	part7.Material = "Plastic"
	part7.BrickColor = BrickColor.new(0,0,0)
	part8.Material = "Plastic"
	part8.BrickColor = BrickColor.new(0,0,0)
	part9.Material = "Plastic"
	part9.BrickColor = BrickColor.new(0,0,0)
	part10.Material = "Plastic"
	part10.BrickColor = BrickColor.new(0,0,0)

end

end)

Code:
local RunService = game:GetService(“RunService”)
local Music = workspace:WaitForChild(“Sound”)
local CurrentCamera = workspace.CurrentCamera

local ScreenShakeSettings = {
CameraMinFOV = 75,
CameraMaxFOV = 80,
CameraMaxVolume = 1200
}

game:GetService(“RunService”).RenderStepped:connect(function()
local CurrentLoudness = Music.PlaybackLoudness
local FOV = ScreenShakeSettings.CameraMinFOV + (ScreenShakeSettings.CameraMaxFOV - ScreenShakeSettings.CameraMinFOV) * (CurrentLoudness / ScreenShakeSettings.CameraMaxVolume)
if FOV >= 75 then
CurrentCamera.FieldOfView = FOV
else
CurrentCamera.FieldOfView = 200
local sound = workspace:WaitForChild(“Sound”)
local Camera = workspace.CurrentCamera
if (sound.PlaybackLoudness/1000) >= 0.30 and Camera.FieldOfView < 100 then
local Properties = {FieldOfView = 68 + (sound.PlaybackLoudness/100)}
local Info = TweenInfo.new(0.09, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local T = game:GetService(“TweenService”):Create(game.Workspace.CurrentCamera, Info, Properties)
T:Play()
else
local Properties = {FieldOfView = 68 - (sound.PlaybackLoudness/1000)}
local Info = TweenInfo.new(0.10, Enum.EasingStyle.Sine, Enum.EasingDirection.In)
local T = game:GetService(“TweenService”):Create(game.Workspace.CurrentCamera, Info, Properties)
T:Play()
end
end
end)

Ok so I gave up on this script and I got a new one that works WAY better! But there’s a problem… I need to do this: while wait() do
script.Parent.Size = Vector3.new(2,0.2,3 game.Workspace.Music.PlaybackLoudness / 45, 2)
end
But there’s always this error!


And I don’t plan on learning how to script ever… I am tired of learning the way that I need to! I rather do what I want to! You feel me! Right?

the issue is the Y coordinate.

position is saved as a Vector3 value
if you use a vector3 it is aranged as X,Y,Z
example
vector3.new (X,Y,Z)
if X is called moving back and forward
Y is going up and down
and Z is going from left to right

the 2nd issue is that the coordinates yu put in are based on worldspace coordinates (so position from coordinates 0,0,0)
not from the part it self

#1 How does vector3 have anything to do with this?
#2 It’s not workspace coordinates. It’s the size of the part! No matter what I do with it… Its always way to small for it to look normal!
What it should look like
image
And what it looks like when I start running the game:
https://i.gyazo.com/c0a344fe1e2270b1e3be88d21f9a0ab3.mp4
All I’m wanting here is to have the speakers to look like in the before photo! But it never turns out that way! Either if I give it specific size or non specific size it wont work and that’s all I can do!
I also realized that the speakers go in both directions of the y-coordinate of the part and it clips through the dj system so I need a fix on that as well. :confused:

1 Like

here the Y vector of the part is set to sizeincrement

this is defined by local sizeincrement = loudness/60
when loudness drops to 0 (lets say the end of a song)
sizeincrement will drop to 0 making the part really small

But not with bricks or cubes or whatever. If a object has a unique shape like a circle it will appear smaller. but with a brick it will only become skinny or flatten. Unless grouped with another object. For me it works Perfectly fine but whenever I play it the x-axis and the z-axis aren’t cooperating with the script I’m dealing with here! Oh and btw if I add the x,y,z axis to the script it wont work… It only works with the y-axis.

Did you make a veritable for size? That might make it easier!

I have no idea what a veritable is lol.

It’s like local size = game.Workspace.vector3 then your number

Any professional l scripters correct me if im wrong but I think that’s should make it where you can easily then ask the script to run the varrible

So like the devking

Local hotdogs = 9

If hotdogs == 9 then
Print(hotdogs)

That’s is a variable

The local
It’s can be used to make things easier

Bro I would try to do that but I stayed up all night trying to edit a video so it might take a while for me to try and confirm it… (I think my eyes are falling out)

Ok, your fine. I’m a noobie scripter I only know if statements rs and variables sand some functions!

while wait() do

script.Parent.Size = Vector3.new(2, game.Workspace.Music.PlaybackLoudness / 45, 2)

end
This is the script. Tell me if there is anything wrong with it that makes it look like this: https://i.gyazo.com/c0a344fe1e2270b1e3be88d21f9a0ab3.mp4

2 Likes

Add if I from of script.Parent

Cause why would that just say that

They just don’t say while wait

That looks like an of statement the only thing after that if that doesn’t work try to add the at the end of your second line of code that you showed me!