I am making an animation for a gun and when I move it stops and when I leave it for a second it also stops.
My animation is on looped and the priority is core.
-- I will show the scipt incase its to do with that
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Tool = script.Parent
local Animation = script:WaitForChild("Animation")
Tool.Equipped:Connect(function()
Humanoid:LoadAnimation(Animation):Play()
end)
Tool.Unequipped:Connect(function()
Humanoid:LoadAnimation(Animation):Stop()
end)
(I have no idea if this is the right category)
Core is the lowest priority and will get overwritten by any other currently playing animations that use the same body parts. If this is to be played when you equip your weapon, I’d set the priority to Action and see if that works.
1 Like
It is doing the same thing. It equips, then unequips in a millisecond. Then when you equip it again it unequips itself after about a second.
I am only using core because I want it to happen when your idle and when you move.
Could it be possible that the toolnone
Animation is also overlapping your current Animation? You should be using Motor6D’s for Tool Grips if you haven’t done so already
Your script looks fine (Apart from using the Humanoid
to load the Animation entirely, when you should be using the Humanoid
's Animator object), so it might just have to do with the Animation itself possibly
1 Like