Why is my animtrack filling up the limit?
As you can see my code only loads the sword swing animation ONCE. Also, I don't think the disabling of the different animation scripts is it because I get this error when I swing the sword too many times.
I got this error: "AnimationTrack limit of 256 tracks for one Animator exceeded, new animations will not be played. (x322)"
01 | local Plr = game.Players.LocalPlayer |
02 | Plr.CharacterAdded:Wait() |
03 | local A 1 = game.ReplicatedStorage.Animate:Clone() |
04 | local A 2 = Plr.Character:WaitForChild( "Animate" ) |
05 | A 1. Parent = Plr.Character |
06 | local E = Plr.Character:WaitForChild( "SwordT" ) |
07 | local U = Plr.Character:WaitForChild( "SwordF" ) |
08 | local Anim = Instance.new( "Animation" ) |
10 | local Hum = Plr.Character:WaitForChild( "Humanoid" ) |
11 | local Swing = Hum:LoadAnimation(Anim) |
12 | local HeadshotId = "595183327" |
13 | local BodyshotId = "7171761940" |
16 | script.Parent.Equipped:Connect( function () |
19 | E:FireServer(script.Parent.Attatch) |
22 | script.Parent.Unequipped:Connect( function () |
28 | script.Parent.Activated:Connect( function () |
32 | script.Parent.Blade.Touched:Connect( function (hit) |
33 | if hit and hit.Parent and hit.Parent:FindFirstChild( "Humanoid" ) and hit.Parent ~ = Plr.Character and I = = false and Swing.IsPlaying then |
35 | game.ReplicatedStorage.DO:FireServer(hit) |
36 | local G = game.ReplicatedStorage.HitGui:Clone() |
37 | G.Parent = game.Workspace |
38 | G.Position = hit.Position |
39 | G.BillboardGui.TextLabel.Text = "-23" |
40 | if hit.Name = = "Head" then |
41 | G.BillboardGui.TextLabel.Text = "-75" |
48 | Plr.Character:WaitForChild( "Humanoid" ):UnequipTools() |
49 | Plr.Character:WaitForChild( "Humanoid" ):EquipTool(script.Parent) |