Animation works in studio, not in game though

Okay, so I have been working on a framework for my first person shooter game. The viewmodel animations load in studio, but when tested in game, it does not load.

Picture of it in studio:

Picture of it in game:

It is meant to look similar to the first picture, for anyone wondering what is happening in second image, that is what it is meant to look like before animations load.

Code:

repeat
	wait()
until game:IsLoaded()

print("[CLIENT]: Framework Loaded")


local Primary = "AKM"
local currentgun = nil
local uis = game:GetService("UserInputService")
local renderstepped = game:GetService("RunService").RenderStepped
local currentcamera = game.Workspace.CurrentCamera

local char = script.Parent
local plr = game.Players.LocalPlayer
local hum = char:WaitForChild("Humanoid")
local hrp = char:WaitForChild("HumanoidRootPart")

local modules = game.ReplicatedStorage.WeaponModules
local models = game.ReplicatedStorage.Viewmodels

-- plr.CameraMode = Enum.CameraMode.LockFirstPerson


local function equip(gun)
	if currentgun ~= gun then
		currentgun = gun
		print("[CLIENT]: "..gun)
		local gun = models[gun]:Clone()
		local module = require(modules[gun.Name])
		gun.Parent = game.Workspace.CurrentCamera
		gun.Name = "Arms"
		
		-- animations start
		
		
		local idle = gun.Animation:LoadAnimation(gun.Idle)
		idle:Play()

image
This is how it looks in explorer, and the “Idle” animation is the one that is not loading.

Any help is appreciated, thank you!

1 Like

Are the animation/s uploaded to the right place. Like are they uploaded to the same place the game is located? For example group, player, or whatever

1 Like

Oh, I didn’t realize. Thank you!

2 Likes

No problem. Glad to help out with it :))

1 Like