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

Animation works in Studio and Test Server, but not in game?

Asked by 6 years ago

I want the animation to play when the player clicks, but it doesn't work in a game. It works in Studio and a Test Server.

script.Parent.Activated:connect(function()
if debounce then 
    local animationswing = Instance.new("Animation")
    if game.Players.LocalPlayer.Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
    animationswing.AnimationId = "rbxassetid://886800502"  --put animation id here
    else
    animationswing.AnimationId = "rbxassetid://886799196"
    end
    local animiTrack = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(animationswing)    
    if mouse.Target:FindFirstChild('Breakable') then
        if (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - mouse.Target.Position).magnitude <= 16 then
        if mouse.Target.Parent ~= workspace.Resources then
            local mousetarget = mouse.Target
            debounce = false
            animiTrack:Play()
            animiTrack:AdjustSpeed(stats["Speed"])
            animiTrack.KeyframeReached:connect(function(kf)
                if kf == "End" then
                script.Parent.Server:FireServer(mousetarget, stats)
                debounce = true
                end
            end)

        end
    end
    end
end
end)

This is in a local script.

Output:

Animation "http://www.roblox.com//asset?id=886799196&serverplaceid=871165592" failed to load in "Animation.AnimationId": Animation failed to load

0
Try asking this in the forums, I do not think there is anything wrong with your code (just briefly scanning through it) just might be something you have to troubleshoot. Go to the fourm section at the side of your roblox page and they should be able to help you. -Tritous Tritous 0 — 6y
0
Can you post the error you got? If there wasn't one in game, then press CTRL + F9 to see the output. OrcaTheFish 95 — 6y
0
Why CTRL + F9? Did nothing different to F9... SSSpencer413 30 — 6y
0
And if you read the post, you should've known...... SSSpencer413 30 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

I tried answering you on the chat but you were offline. Make sure your animation is created by you, or is in the group creations. The Anim, must be own by you or the group depending on the game you are making either it be a game made by you, or a game in a group.

(edited)

Hope this helps, it's how I fixed my animation problems.

0
Already tried that. Turns out the problem was my studio is corrupted D: SSSpencer413 30 — 6y
0
It was owned by the group. SSSpencer413 30 — 6y
Ad

Answer this question