local tool = script.Parent
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local anim = script:WaitForChild("Animation")
-- Load the animation
local animTrack = hum:LoadAnimation(anim)
animTrack.Priority = Enum.AnimationPriority.Action -- overrides default tool hold
animTrack.Looped = true -- we’ll handle stopping manually
-- Play when equipped
tool.Equipped:Connect(function()
if not animTrack.IsPlaying then
animTrack:Play()
end
end)
-- Stop when unequipped
tool.Unequipped:Connect(function()
if animTrack.IsPlaying then
animTrack:Stop()
end
end)
#Animation bug or im stupid idk please check its basic
1 messages · Page 1 of 1 (latest)
make the equip animation not loop
fast reply thank god
well i believe it automatically goes to the normal tool holding animation of roblox itself
like it plays the animation
but at the last frame once it finishes it goes back to the default tool holding animation
i want mine to stay
so yeah still didnt work
redo the animation
** You are now Level 6! **
sorry explain a bit more about what you mena
if you want me to redo the animation to turn off looping. it never had it on
its priority is action
i guess the first key frame that you have is not where u want to stay
the keyframes go from the very start. being idle and standing still going to him holding the flashlight as you see. that ofc being the end frame. why now
imma see if i can present a screenshot one minute
oh damn
is it because of this?
an empty space at the right
im not??
u should do something like this
hm wait i dont understand whats going on in the pic
there is just one set of frames, at the sec 0, making it loop, its gonna stay where i want
but i do have keyframes at 0
why would i remove the ones on the right if they are what open my flashlight
cuz thats making it not stay...
but then my flashlight wont play its animation 😭
i mean
i get what you mean. but like
delete what u have at sec 0
and move
what you have at sec 0.5 to sec 0
thats it
then make 2 animations
or make a event animation
damn bro alright
I deleted because I forgot that what I said would do absolutely nothing for it lol
xD, yea i was thinking that when i read it
there is a easy solution
but i dont recommend that option
yeah
you could use the
the
first animation that u using
and put a task.wait(0.4) and then animTrack:AdjustSpeed(0)
yeah
that would work, and without making it loop
I mean, this shouldn't be a problem as long as you do it right
What is the second set of keyframes even doing
im still trying to begin animation so i started off easy with a flashlight
they are what pull the flashlight up. after the first set. the first set was added to make it a bit slower. with easing styles.
the first set
the second
Yeah
Yeah, but use the ones on the right instead of getting rid of them
now it doesnt use any easing style. or be a bit slow atleast like i want 0.5.
i didnt get rid of them i deleted the first set and dragged the right ones to zero
Make a second animation of it pulling the flashlight up, and have it play the holding animation after it finishes
So basically what the other guy said lol
alright then
You can just use your original animation without the loop enabled for the holding animation, it'll just take a few extra lines from there
local tool = script.Parent
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local anim = script:WaitForChild("Animation")
local holdUpAnim = --path to your animation.
-- Load the animation
local animTrack = hum:LoadAnimation(anim)
local animTrack2 = hum:LoadAnimation(holdUpAnim)
animTrack.Priority = Enum.AnimationPriority.Action
animTrack2.Priority = Enum.AnimationPriority.Action -- overrides default tool hold
animTrack.Looped = true -- we’ll handle stopping manually
-- Play when equipped
tool.Equipped:Connect(function()
animTrack2.Play()
animTrack2.Ended:Once(function()
if not animTrack.IsPlaying then
animTrack:Play()
end
end
end)
-- Stop when unequipped
tool.Unequipped:Connect(function()
if animTrack.IsPlaying then
animTrack:Stop()
end
if animTrack2.IsPlaying then
animTrack2:Stop()
end
end)