Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Animations never work for me and I need some help so I don't go insane?

So I am trying to make a swing animation and I've followed multiple tutorials and not a single one of them work ever and I am getting super upset. This is the code inside a tool (the tool has this local script, a handle part, and an Animation with my animation id):

script.Parent.Activated:Connect(function()
	local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
	animation:Play()
end)

6 comments

0

Do you get any errors? Do you own the animation? Does Activated actually run?

0

are u pre-loading the animation?

0

Activated actually does run, no errors, and I made the animation so I assume I own the animation. What does pre-loading the animation mean?

0

Make sure the animation is created with a high priority or else it may not override your character's default animations.

0

Try setting your animation's priority to Action. You can do this easily from roblox's animation editor.

0

Does the animation have a AssetId

1 answer

Set your animation to a higher priority so it will player over default animations and you can play your animation like this.

local Anim = Instance.new("Animation") -- Create the animation.
Anim.AnimationId = "rbxassetid://[YOURIDHERE]" -- Remove the brackets and enter your animation's asset id
local PlayAnim = player.Character.Humanoid:LoadAnimation(Anim) -- Loading the animation into the player

PlayAnim:Play() -- Playing your animation.

This discussion is preserved as it was. New answers, comments, and votes are closed.