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

Animation won't run while walking nor will it play when button is pressed?

Asked by 5 years ago
local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local smash = Instance.new("Animation")
smash.AnimationId = 'rbxassetid://2941877623'
local usos = char:WaitForChild("Humanoid"):LoadAnimation(smash)
local debounce = false
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E and debounce == false then
char.Humanoid.WalkSpeed = 0
debounce = true
usos:Play()
wait(4)
debounce = false
char.Humanoid.WalkSpeed = 16
end
end)

When I try to run the animation while walking, it starts and then stops immediately, but the walk speed is set to 0. Not only that, but if the animation is playing, and I press a button, the animation stops. Please help.

1 answer

Log in to vote
0
Answered by 5 years ago

It most likely has to do with the animation weight when you uploaded it to Roblox. Re-open the animation you made in the editor and go to edit->Set Priority-> Action. Then Re-upload the animation.

Ad

Answer this question