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

The animation I made does not work?

Asked by 6 years ago

So I tried making animation and tried to make it work using this script (Animation named Attack is inside this local script which is inside a tool)

tool = script.Parent
tool.Equipped:connect(function(mouse)
    local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)
    attack:Play()
end)

and it won't seem to play the animation, I just uploaded the animation tens of minutes ago, does that have something to do with it?

0
I will try to help you a second. royee354 129 — 6y
0
It works on animation builder but I can't seem to make it work with my tool hmm xxXTimeXxx 101 — 6y
0
I will help you just let me get my studio up. royee354 129 — 6y
0
Try using localplayer and player.Character.humanoid instead. ronitrocket 120 — 6y
View all comments (2 more)
0
still doesn't work T_T xxXTimeXxx 101 — 6y
0
I tried everything, maybe it's my animation that's the problem? But it plays when I play it on the editor hmm xxXTimeXxx 101 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

Chances are your priority of the attack it too low so Roblox's animation plays over it.

Solution:

Open up the editor, load into animation through exports (so import) it. Then you wanna press on Settings. There will be an option to change the animation Priority, click Priority and make sure the priority is "action". After re-export is and since the animation Id stays the same, it should work!

Code:

Since there is no real problem with the script I'm gonna improve it for you:

local tool = script.Parent -- use local variables
tool.Equipped:Connect(function(mouse) -- :Connect not :connect, :connect is deprecated
    local attack = tool.Parent.Humanoid:LoadAnimation(script.Attack) -- script.Parent is tool so just use tool.Parent
    attack:Play()
end)

Hoped this helped!

0
I already set the priority to action but ill try it again now thanks! xxXTimeXxx 101 — 6y
0
Still doesn't work :( Set priority to action and tried the script inside the tool, still does nothing on equip hmmm xxXTimeXxx 101 — 6y
Ad

Answer this question