LoadAnimation requires the AnimationController object (MP5.AnimationController) to be a descendant of the game object?
1 | local Gun = game.ReplicatedStorage.GunStorage.MP 5 :Clone() |
2 | local Controller = Instance.new( "AnimationController" ) |
3 | local ShootValue = game.ReplicatedStorage.GunValue.MP 5 :WaitForChild( "ShootingAnim1" ).Value |
4 | local ShootAnim 1 = Instance.new( "Animation" ) |
5 | ShootAnim 1. AnimationId = "rbxassetid://" ..ShootValue |
6 | ShootAnim 1. Parent = Gun |
7 | Controller.Parent = Gun |
8 | local LShootAnim 1 = Controller:LoadAnimation(ShootAnim 1 ) |
LoadAnimation requires the Humanoid object (MP5.Humanoid) to be a descendant of the game object? umm...
01 | local Gun = game.ReplicatedStorage.GunStorage.MP 5 :Clone() |
02 | local GunHum = Gun:WaitForChild( "Humanoid" ) |
03 | local Controller = Instance.new( "AnimationController" ) |
04 | -- |
05 | local ShootValue=game.ReplicatedStorage.GunValue.MP5:WaitForChild("ShootingAnim1").Value |
06 | local ShootAnim 1 = Instance.new( "Animation" ) |
07 | ShootAnim 1. AnimationId = "rbxassetid://" ..ShootValue |
08 | -- |
09 | ShootAnim1.Parent=Gun |
10 | Controller.Parent = Gun |
11 | local LShootAnim 1 = GunHum:LoadAnimation(ShootAnim 1 ) |
Basically you forgot to parent the animation on line 6
1 | local ShootAnim 1 = Instance.new( "Animation" ) |
2 | ShootAnim 1. AnimationId = "rbxassetid://" ..ShootValue |
3 | ShootAnim 1. Parent = gun |
4 | -- Parent the animation? |
The animations do need to be in the game for them to work
Another EDIT
The more I look at yours it makes me think because I don't think you can load animations onto a object that isn't in workspace.