#Animation bug or im stupid idk please check its basic

1 messages · Page 1 of 1 (latest)

lapis crescent
#
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)
uncut stirrup
#

make the equip animation not loop

lapis crescent
#

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

buoyant monolith
nocturne lintelBOT
#

studio** You are now Level 6! **studio

lapis crescent
#

if you want me to redo the animation to turn off looping. it never had it on

#

its priority is action

buoyant monolith
lapis crescent
#

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

buoyant monolith
#

hm no

#

u are looping, its not gonna stay

lapis crescent
#

im not??

buoyant monolith
#

u should do something like this

lapis crescent
#

hm wait i dont understand whats going on in the pic

buoyant monolith
#

there is just one set of frames, at the sec 0, making it loop, its gonna stay where i want

lapis crescent
#

but i do have keyframes at 0

#

why would i remove the ones on the right if they are what open my flashlight

buoyant monolith
#

cuz thats making it not stay...

lapis crescent
#

but then my flashlight wont play its animation 😭

buoyant monolith
#

i mean

lapis crescent
#

i get what you mean. but like

buoyant monolith
#

delete what u have at sec 0

#

and move

#

what you have at sec 0.5 to sec 0

#

thats it

lapis crescent
#

hm fine lemme see

#

i mean it worked. but its so fast. i dont want that

buoyant monolith
#

or make a event animation

lapis crescent
#

where would that be

#

oh okay he deleted it

lapis crescent
burnt nexus
buoyant monolith
buoyant monolith
#

but i dont recommend that option

lapis crescent
#

yeah

buoyant monolith
#

you could use the

lapis crescent
#

the

buoyant monolith
#

first animation that u using

#

and put a task.wait(0.4) and then animTrack:AdjustSpeed(0)

lapis crescent
#

yeah

buoyant monolith
#

that would work, and without making it loop

burnt nexus
#

What is the second set of keyframes even doing

lapis crescent
lapis crescent
#

the first set

#

the second

burnt nexus
#

Oh, I see the problem

#

just use only the second set

lapis crescent
#

please

#

and put it at zero right?

burnt nexus
#

Yeah

lapis crescent
#

i did

burnt nexus
#

Yeah, but use the ones on the right instead of getting rid of them

lapis crescent
#

now it doesnt use any easing style. or be a bit slow atleast like i want 0.5.

burnt nexus
#

Oh

#

I see

lapis crescent
#

i didnt get rid of them i deleted the first set and dragged the right ones to zero

burnt nexus
#

Make a second animation of it pulling the flashlight up, and have it play the holding animation after it finishes

burnt nexus
lapis crescent
#

alright then

burnt nexus
#

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)