I made a gun and tried to animate it. It has a Humanoid and a Root part (primary part) so it makes a custom rig. However, whenever I try to play the animation it wont work. I made a different script before and it worked perfectly
script 1
local gun = game.ReplicatedStorage.GunModels.MP40:Clone()
local mp40idle = gun.Humanoid:LoadAnimation(game.ReplicatedStorage.Modules.SETTINGS.Animations.MP40.Idle)
mp40idle:Play()
script 2
local gun = game.ReplicatedStorage.WeaponsModels.MOSINNAGANT:Clone()
local idle = gun.Humanoid:LoadAnimation(game.ReplicatedStorage.WeaponModules.MosinNagant.AnimationsFolder.Idle)
idle:Play()
Can anyone please explain to me why script 1 wont work but script 2 works? The error is that the script couldnt find the Humanoid inside the cloned model.

6 comments
I have a very similar script, just different model name. It also has a Humanoid and its cloned, yet I can Load the animation and the whole ""Parent" thing works.
Okay but you still need to set the Parent before loading the animation
So rather than saying what is basically the equivalent of "It works on my machine" how about you try out my solution by setting the Parent first and then tell me if it works or not
Now I fixed it, I found the model manually by finding it inside the camera so I will be able to find the Humanoid. Thanks. Its still wierd to me since I got the exact same script with different model and variable names and it works. (I editted my question for you to see) Thanks again for the help.
:Clone().Parent = workspace
Hi eLunate :3