Currently, im working on my fps game, I was making a ViewModel and it didn’t load the animation, no errors just not loading it, does anyone know why? (I used the blender plugin to rig this exact model and made it)
local player = game.Players.LocalPlayer
local char = player.Character
local cam = workspace.Camera
local run = game:GetService("RunService")
local arms = game.ReplicatedFirst.FPSARMS:Clone()
local MyGun = script.Parent
local GunHandle = MyGun:WaitForChild("Handle")
arms.Parent = cam
MyGun.Equipped:Connect(function()
local Humanoid = arms:WaitForChild("Humanoid")
local Animation = arms:WaitForChild("Animation")
local loadAnimation = Humanoid:LoadAnimation(Animation)
loadAnimation:Play()
local FPSARMS = game.Workspace.Camera:WaitForChild("FPSARMS")
FPSARMS.LeftArm.Transparency = 0
FPSARMS.RightArm.Transparency = 0
GunHandle.Transparency = 1
local Humanoid = arms.Humanoid
local Animation = arms.Animation
local LoadAni = Humanoid:LoadAnimation(Animation)
LoadAni:Play()
local GunModel = FPSARMS.GunModel:GetChildren()
for i, value2 in pairs(GunModel) do
value2.Transparency = 0
end
end)
if MyGun.Equipped then
arms.Parent = cam
run.RenderStepped:Connect(function()
arms:SetPrimaryPartCFrame(cam.CFrame * CFrame.new(0,-1.6,-2.5) * CFrame.Angles(0,1.5,0))
end)
end
MyGun.Unequipped:Connect(function()
arms.Parent = cam
local FPSARMS = game.Workspace.Camera:WaitForChild("FPSARMS")
FPSARMS.LeftArm.Transparency = 1
FPSARMS.RightArm.Transparency = 1
local GunModel = FPSARMS.GunModel:GetChildren()
for i, value in pairs(GunModel) do
value.Transparency = 1
end
end)