iiSt3veii
(Jeano)
September 17, 2022, 5:30pm
#1
I made a tool animation for the flashlight and there is custom animations but if I equip the tool the animations glitch and the flashlight moves with the arm when running instead of staying up like the animation is supposed to do
video: https://gyazo.com/478fe534b49815f01caaccc51c7a2640
flashlight animation: https://gyazo.com/1eb02f70ed2b9c571f520197dfe16e3a
Towphy
(Towphy)
September 17, 2022, 5:31pm
#2
iiSt3veii
(Jeano)
September 17, 2022, 5:32pm
#3
the flashlight animation priority is action and I tried action2 but that also didn’t work
Towphy
(Towphy)
September 17, 2022, 5:33pm
#4
do you mind sending your code?
iiSt3veii
(Jeano)
September 17, 2022, 5:34pm
#5
local tool = script.Parent
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/Asset?ID=10938319864"
local track
tool.Equipped:Connect(function()
track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action
track.Looped = true
track:Play()
end)
tool.Unequipped:Connect(function()
if track then
track:Stop()
end
end)
Towphy
(Towphy)
September 17, 2022, 5:36pm
#6
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/Asset?ID=10938319864"
anim.Parent = script.Parent.Parent
local track = script.Parent.Parent.Humanoid.Animator:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action2
track.Looped = true
tool.Equipped:Connect(function()
track:Play()
end)
tool.Unequipped:Connect(function()
track:Stop()
end)
try using this, simplifying the code a bit.
also, Humanoid:LoadAnimation is deprecated! Switch over to using Humanoid.Animator:LoadAnimation
iiSt3veii
(Jeano)
September 17, 2022, 5:37pm
#7
ohh i see now it works thanks
char limit char limit
Forummer
(Forummer)
September 17, 2022, 10:17pm
#8
To explain your issue you were loading and subsequently playing a new animation track instance each time the tool’s ‘Equipped’ event/signal was fired.