Dance Animation Speed Gui

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear! I want to make the dance GUI look really good and learn more about scripting.

  2. What is the issue? Include screenshots / videos if possible! I want to make a dance speed button gui where you speed up the dance or slow it down like thisimage

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub? I try a lot of stuff but none of them work and I looked on developer hub but there is nothing like what Im trying to looking for.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

-- This is an example Lua code block

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

You can use Track:AdjustSpeed to change the speed.

1 Like

So I will put this local script in a text button?

local normalSpeedTime = animationTrack.Length / animationTrack.Speed
animationTrack:AdjustSpeed(3)
local fastSpeedTime = animationTrack.Length / animationTrack.Speed
print(“At normal speed the animation will play for”, normalSpeedTime, “seconds”)
print(“At 3x speed the animation will play for”, fastSpeedTime, “seconds”)

local animationTrack = humanoid:LoadAnimation(animation)

local normalSpeedTime = animationTrack.Length / animationTrack.Speed
animationTrack:AdjustSpeed(3)
local fastSpeedTime = animationTrack.Length / animationTrack.Speed

print(“At normal speed the animation will play for”, normalSpeedTime, “seconds”)

print(“At 3x speed the animation will play for”, fastSpeedTime, “seconds”)

Sorry for the late response but you’d connect a event to detect if the button has been clicked, get all the playing tracks, loop through the tracks and call the function (im on mobile so there might be mistakes):

local Players = game:GetService('Players')

local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()

local humanoid = char:WaitForChild('Humanoid')
local animator = humanoid:WaitForChild('Animator')

script.Parent.Activated:Connect(function()
    local tracks = animator:GetPlayingAnimationTracks()
   
    for _, track in pairs(tracks) do
        track:AdjustSpeed(2)
    end
end)
1 Like

Thank you but like the part “currentTrack:AdjustSpeed(2)” currentTrack has a blue line thats is ok right?

Small typo, replace “currentTrack” with “track”.

thank you so much for helping.

1 Like

i change a bit of the script but like when im walking it change the speed too i want it only change the dance speed.

local Players = game:GetService(‘Players’)

local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local dancing = false

local humanoid = char:WaitForChild(‘Humanoid’)
local animator = humanoid:WaitForChild(‘Animator’)

script.Parent.Activated:Connect(function()
local tracks = animator:GetPlayingAnimationTracks()
while dancing do
wait()
for _, track in pairs(tracks) do
track:AdjustSpeed(5)
end
end
end)