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

Why does the Idle animation play over my Animation even though it's priority is Action?

I am in need of help with this

so i'm trying to make a taser thing that stuns people, so i created an animation for when you get stunned hit by the taser, the only problem is that when the command is given to play the animation, it only plays it for a second and then goes back to the idle animation. I have set the animation's priority to "Action" so it should be playing over everything else, here is the code for if i'm doing something wrong.

local Anim = Instance.new("Animation")

Anim.Name = "Taser"

Anim.AnimationId = "http://www.roblox.com/asset/?id=2939741656"

local LoadNewAnimation = Humanoid:LoadAnimation(Anim)

LoadNewAnimation.Priority = Enum.AnimationPriority.Action

LoadNewAnimation:Play()

sorry it's not formatted like normal code but i'm trying to paste it and only one line comes out as code so :/, excuse my noobiness

1 answer

✓ Accepted answer

You don't have to do any of that just make it so its plays when u hit the npc u don't have to make a script that changes the Priority just a script that plays the animation and in the animation editor simply make it that priority already.


local Anim = Instance.new(“Animation”)
Anim.Name = “Taser”
Anim.AnimationId = “http://www.roblox.com/asset/?id=2939741656”

local LoadNewAnimation = Humanoid:LoadAnimation(Anim)
LoadNewAnimation:Play()

2 comments

0

Wth StackEdit omgg

0

And of course StackEdit doesn't remember me even editing so i can't change npc to player

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