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

Help with my punch tool animation (not working at all)?

Asked by
6zk8 95
4 years ago
local player = game.Players.LocalPlayer
local char = player.CharacterAdded:Wait()

script.Parent.Equipped:Connect(function()
    local animation = char.Humanoid:LoadAnimation(script.Parent.Animation)
    animation.Priority = Enum.AnimationPriority.Action

    animation:Play()
    print("yo")
end)

I will edit this part later, need to do something

0
Verify that it is detecting your CharacterAdded Warfaresh0t 414 — 4y

2 answers

Log in to vote
1
Answered by 4 years ago

Just a few recommendations and reminders for you that may fix the code if you still need help. The first is line 2; consider replacing line 2 with this:

repeat wait() until player.Character
local char = player.Character

That will completely pause the script until the char is found.

In addition make sure the animation joints match with the character joints. An r6 anim won't work on an r15 and vise-versa.

I hope this helps. Till next time

Ad
Log in to vote
1
Answered by 4 years ago

Instead of doing it through a script, try changing the animation priority through the animation editor. (3 dots > Set Animation Priority > Action).

0
Thanks, it did help me but the answer above did more. You earned yourself an upvote :) 6zk8 95 — 4y

Answer this question