My Animation script plays a simple Throw Animation:
wait()
local CanEmote = true
local Player = game.Players.LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = character.Humanoid
local Animation = Humanoid:LoadAnimation(script.Throw)
script.Parent.MouseButton1Click:Connect(function()
if CanEmote then
Animation:Play()
CanEmote = false
wait(1)
CanEmote = true
else print("An Error Occured")
end
end)
In studio, the output is the animation plays. But In the actual Roblox game, It doesn't load. I go to the Developer Console. I get an error saying my animation failed to load. I try this code:
local ContentProvider = game:GetService("ContentProvider")
local ThrowId = "rbxassetid://2192870054"
local Animation = Instance.new("Animation")
Animation.AnimationId = ThrowId
local assets = {Animation}
ContentProvider:PreloadAsync(assets)
print("All Assets Loaded")
It doesn't work. I don't know why, but it won't load. I have this code in a LocalScript, and it even works in studio. Can someone tell me why it isn't loading and what I have to do to fix this please?
--Is there some way I can store the animation so the game has it in it's cache?

1 comment
Please tell me what I am doing wrong or what code I have to write to fix this? Is my game memory to full? Is there too much lag?