#Preloading animation issue

1 messages · Page 1 of 1 (latest)

valid python
#

Currently trying to polish up my dash script with animations, i noticed the first time the dash animation will be extremely laggy
I'm currently trying to preload animations with this code

local function preloadAnimations(player)
    local animationsFolder = RPS:WaitForChild("Assets"):WaitForChild("Animations")
    local animationsToPreload = {}

    -- Collect all animations in the folder
    for _, animation in pairs(animationsFolder:GetChildren()) do
        if animation:IsA("Animation") then
            table.insert(animationsToPreload, animation)
        end
    end

    -- Preload animations using PreloadAsync from ContentProvider
    ContentProvider:PreloadAsync(animationsToPreload)
end```
I still have the same issue and im just a bit stumped here
just for reference above code should be one of the first things that run when my player joins
#

ill send a clip of it acting up when my medal stops being weird

valid python
#

bump cuz this is killing me

safe stream
#

I'm pretty sure you have to play the animations on the humanoid

#

Not sure if there is a better fix but under the last comment try
For _, Animation in animationsToPreload do
player.Character.Humanoid:LoadAnimation(Animation):Play()

#

Indent the second line obviously

#

At it might look a little ugly if your game had no loading screen or anything

#

You might be able to fix that by stopping right after but try the solution above first

valid python
#

Yeah ended up just creating a module script to handle preloading of everything but still had to play it on the humanoid so thanks for that tip

winged pineBOT
#

studio** You are now Level 1! **studio

valid python
#

not sure why preloadasync just does nothing

safe stream
#

Roblox animations are werid

winged pineBOT
#

studio** You are now Level 4! **studio