Roblox walkspeed change during animation not working?

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

  1. What do you want to achieve? This script has worked days before so I just want to fix it

  2. What is the issue? A script that changes the player’s walkspeed during an animation stopped worked just yesterday and heres the code:

		local Track = Instance.new("Animation")
			Track.AnimationId = "rbxassetid://5816501620"
			local Animation= character.Humanoid:LoadAnimation(Track)
			Animation:Play()
			character.Humanoid.WalkSpeed = 0 
			character.Humanoid.JumpPower = 0
			Animation.Stopped:Wait() 
			character.Humanoid.WalkSpeed = 16  
			character.Humanoid.JumpPower = 40

Sir, what exactly is broken? Is the animation not playing, is the player’s speed not changing? What is happening?

I guess you could do an if statement where it checks whether or not the animation is playing, and then you can do the rest.

Edit: To check if it fired, you can also add a print() function!

walkspeed not changing
[30 :b:hars, dont flag because i am adding m8]

The animation plays after UIS and remote event is fired

What changed between yesterday and today that might be causing this? Is character still properly defined?

local Track = Instance.new(“Animation”)
Track.AnimationId = “rbxassetid://5816501620”
local Animation = character.Humanoid:LoadAnimation(Track)
Animation:Play()
character.Humanoid.WalkSpeed = 0
character.Humanoid.JumpPower = 0
Animation.Stopped:Wait()
character.Humanoid.WalkSpeed = 16
character.Humanoid.JumpPower = 40

literally nothing, I playtested my game and my character wasn’t frozen during the animation playing

1 Like

local Track = Instance.new(“Animation”)
Track.AnimationId = “rbxassetid://5816501620”
local Animation = character.Humanoid:LoadAnimation(Track)
Animation:Play()
character.Humanoid.WalkSpeed = 0
character.Humanoid.JumpPower = 0
Animation.Stopped:Wait(1)
character.Humanoid.WalkSpeed = 16
character.Humanoid.JumpPower = 40

1 Like