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

Animation Problems: Editor Won't Play and Animation won't work?

Asked by 6 years ago

Hi All,

I'm a newbie so please bare with me! Down below there is code I have horribly written. Firstly when I make an animation with Roblox's animation editor after making it, it doesn't even play so it could be an animation problem. If so, I cant really find free animations to use on Roblox :( so I don't know what to do about that. My code is kind of messed up, so if anyone can direct me on how to fix that would be great!

    function onKeyPress(actionName, userInputState, inputObject)
    if userInputState == Enum.UserInputState.Begin then
    print("Hi")

    local animation = Instance.new("Animation")
    animation.AnimationId = "http://www.roblox.com/asset?id=889431440"

    local trackanimation = nil
    local playability = true
    AnimLoaded = humanoid:LoadAnimation(animation)
    function playAnimation(AnimationSource)
        if playability == true then
        local plr = game.Players.LocalPlayer
        trackanimation = plr.Character.Humanoid:LoadAnimation(animation)

        trackanimation.KeyframeReached:connect(function()
        print("Working")
        end)
        trackanimation:Play()
        end
        end
        AnimLoaded:Play()
        end
        end

        game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.K)
0
I had a hard time with this to, but I think you should test your animations in offline studio (the one that's not in develop) ventrixion 27 — 6y

Answer this question