local songprofile = game.Players.LocalPlayer.PlayerScripts:WaitForChild("SoundPlayer")

songprofile.Sound.AttributeChanged:Connect(function()
	script.Parent.progress.Size = UDim2.new(songprofile.Sound.TimePosition / songprofile.Sound.TimeLength, 0, 1, 0)
end)

SoundPlayer is a folder in PlayerScripts that has a Sound in it, its working with my play script (LocalScript) but not my timeline script (LocalScript)(This one). It just does nothing and gives me no errors, what could be the problem here? I'm basically brand new to Roblox's sound system, so I don't have much of an idea on what I'm doing.

my goal is to make a frame (script.Parent) get covered by another frame (progress) proportional to how far in the sound it is. Like a video player or sound player. Dividing TimePosition by TimeLength gives me a percentage of how far into the song it is and it just so happens UDim2 uses percentages (Scale), so I used it there.

4 comments

0

Personally I've never used sound before but try adding prints at different parts of the code and trying to figure out where it's not working, for example put one before the if statement and after to see if it's passing the if statement

0

@Barty200 Tried that and it seems the problem is with line 3, though I doubt line 4 would work ether if that isnt.

0

TimePosition stays constant apparently. You'll have to keep track of the position within the audio manually

0

TimePosition stays constant apparently. You'll have to keep track of the position within the audio manually. Tedious, I know