01 | game:GetService( "RunService" ).RenderStepped:Connect( function () |
02 | local loudness = workspace.Songs.MusicPlayer.PlaybackLoudness |
03 | if loudness > = 100 then |
04 | game.Workspace.test 1. Material = "Neon" |
05 | game.Workspace.test 1. BrickColor = BrickColor.new "Teal" |
06 | else |
07 | game.Workspace.test 1. Material = "Metal" |
08 | game.Workspace.test 1. BrickColor = BrickColor.new "Really black" |
09 | end |
10 | end ) |
I know how to make it go with the loudness but is there a way to make the colors change smoothly?
test1 = a brick
In order to make it run smoothly, you could take advantage of Color3s.
Color3.new(r,g,b)
and Color3.fromRGB(r,g,b)
allow you to construct a color by simply plugging in numbers to the constructor. If you run BrickColor.new(Color3)
, you then get a brick color from that Color3.
As a result, you could simply write a function that calculates r,g,b values based on loudness and use that to create a Color3.
I found a way that could make the brickcolor change smoother (by using Color3 and set the value to playbackloudness of the audio: But it couldn't change the material
01 | local loudness = workspace.Songs.MusicPlayer.PlaybackLoudness + 0 -- Change the amount if needed to make the brick brighter / darker |
02 |
03 | game:GetService( "RunService" ).RenderStepped:Connect( function () |
04 | game.Workspace.test 1. Color = Color 3. new(loudness ,loudness ,loudness) |
05 | if loudness > = 100 then |
06 | game.Workspace.test 1. Material = "Neon" |
07 | end |
08 | if loudness < = 50 then |
09 | game.Workspace.test 1. Material = "Metal" |
10 | end |
11 | end ) |
I hope this would help you :D I haven't checked it yet..if it didn't help.................sorry
Use Tweenservice, there's no need for renderstepped here or anything, read up on how to make a rainbow effect here and just change it to the colors you want.
https://devforum.roblox.com/t/how-to-create-a-simple-rainbow-effect-using-tweenservice/221849