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

How to size a part according to music? [closed]

Asked by 6 years ago

Say that you have a part. How would you change some of it's Vector3 values (i.e. changing the Y Axis of the size for the part with the music being played). Sort of like audio visuals. Thanks.

0
do you have any attempts? User#19524 175 — 6y
0
Usually values are changed by using the = operator. User#25115 0 — 6y
0
Which value are you aiming at doing this with: PlaybackLoudness, Volume, Pitch, etc.? DeceptiveCaster 3761 — 6y

Closed as Non-Descriptive by zblox164, IcyEvil, yHasteeD, 1TheNoobestNoob, DeceptiveCaster, and Lugical

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

2 answers

Log in to vote
4
Answered by 6 years ago

Alrighty, so this is actually pretty simple. All you would have to do is use PlaybackLoudness to resize the part. Here is an example.

1local part = workspace:WaitForChild('Part');
2local sound = part:WaitForChild('Sound');
3part.Anchored = true;
4 
5while wait() do
6part.Size = Vector3.new(5,sound.PlaybackLoudness/5,5);
7end
Ad
Log in to vote
0
Answered by 6 years ago

Roblox Has The Same thing and they do it with guis too. Here is my script it uses four different ones and makes it look like a sound wave while playing an audio I made!

01-- to be placed in StarterPlayer > StarterPlayerScripts
02 
03local Players = game:GetService("Players")
04local LocalPlayer = Players.LocalPlayer
05local bar1 = game.Workspace.AudioSpectrum.Part1
06local bar2 = game.Workspace.AudioSpectrum.Part2
07local bar3 = game.Workspace.AudioSpectrum.Part3
08local bar4 = game.Workspace.AudioSpectrum.Part4
09local bar5 = game.Workspace.AudioSpectrum.Part5
10local bar6 = game.Workspace.AudioSpectrum.Part6
11local bar7 = game.Workspace.AudioSpectrum.Part7
12local bar8 = game.Workspace.AudioSpectrum.Part8
13local sound = Instance.new("Sound")
14local maxLoudness = 75000
15 
View all 49 lines...