Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Animation doesnt play for a viewmodel?

Asked by 5 years ago

I made a viewmodel thats supposed to play a animation. However, It doesnt play.

script:

local realgun = game.ReplicatedStorage.PlayerHandgun
local cam = game.Workspace.CurrentCamera

local gun = realgun:Clone()
gun.Parent = cam

local anim = gun.Humanoid:LoadAnimation(gun.Idle)
anim.Looped = true
anim:Play()


game:GetService("RunService").RenderStepped:Connect(function()
    gun:SetPrimaryPartCFrame(cam.CFrame * CFrame.new(-0.5,-2,-2))
end)

No errors found.

0
There is a bug with looping animations and replicating them to players. User#5423 17 — 5y
0
also make a variable of CFrame.new(-0.5,-2,-2) it is a constant value User#5423 17 — 5y

Answer this question