My animation is failing to load in Roblox Player?
Asked by
6 years ago Edited 6 years ago
My Animation script plays a simple Throw Animation:
03 | local Player = game.Players.LocalPlayer |
04 | local character = Player.Character or Player.CharacterAdded:Wait() |
05 | local Humanoid = character.Humanoid |
06 | local Animation = Humanoid:LoadAnimation(script.Throw) |
08 | script.Parent.MouseButton 1 Click:Connect( function () |
15 | else print ( "An Error Occured" ) |
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:
01 | local ContentProvider = game:GetService( "ContentProvider" ) |
05 | local Animation = Instance.new( "Animation" ) |
06 | Animation.AnimationId = ThrowId |
08 | local assets = { Animation } |
09 | ContentProvider:PreloadAsync(assets) |
10 | 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?