Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why Won't the Animation Play Smoothly?

Asked by 1 year ago
Edited 1 year ago

Hello, So basically I made an animation for a bus model and I made this local script that makes the bus animation play for you when you enter a game:

    local bus = game.Workspace:WaitForChild("SchoolBusAnim")
    local animationController = bus:FindFirstChild("AnimationController")

    if animationController then
        local animator = animationController:FindFirstChild("Animator") or Instance.new("Animator",animationController)
        local animations = {}
        local busGoesOff = animationController:FindFirstChild("BusGoesOff")

        if busGoesOff then
            animations.BusGoesOff = animator:LoadAnimation(busGoesOff)
            animations.BusGoesOff:Play()
        else
            print("Animation BusGoesOff not found")
        end
    else
        print("AnimationController not found")
    end

This script works well but when I test the game the animation is so laggy, it's like 10 fps, although I made the animation in 100 fps. One time when I was testing, I opened the output and the and the size of the game's viewport got smaller, and when it did the animation would play smoothly, but once I close it, it's just really laggy. I really don't understand. Is it because of the script, is it a studio bug, or is it the animation. Thank you very much if you help me.

Answer this question