I am making a tool that you can hold in both hands, and to do that I need to make an animation to bring both arms up. The problem is whenever the player walks, the arm moves up. I tried setting the priority to action and action4 and nothing changes. I even tried setting the priority in the animation editor and nothing changed either.
Parts of the script that handles animation:
local AnimationIds = {
"http://www.roblox.com/asset/?id=106437272933745"
}
local tracks = nil
local function loadAnimations(Humanoid)
if not Humanoid then return end
Tracks = {}
for Index, AnimationId in pairs(AnimationIds) do
local Animation = Instance.new("Animation")
Animation.AnimationId = AnimationId
Animation.Parent = Humanoid
local Track = Humanoid:LoadAnimation(Animation)
Track.Priority = Enum.AnimationPriority.Action4
Tracks[Index] = Track
end
end
player.CharacterAdded:Connect(function()
equipped = false
deleteSlingers()
Tracks = nil
local char = player.Character
local humanoid = char:WaitForChild("Humanoid")
loadAnimations(humanoid)
end)
tool.Unequipped:Connect(function()
if Tracks then
for _, track in pairs(Tracks) do
if track.IsPlaying then
track:Stop()
end
end
end
end)
tool.Equipped:Connect(function()
if Tracks and Tracks[1] then
Tracks[1]:Play()
end
end)
local char = player.Character
local humanoid = char:WaitForChild("Humanoid")
loadAnimations(humanoid)
Video showing the issue: